This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Properly handle VIEW_CONVERT_EXPR in LHS (fixes 4.5 ACATS tests)


On Mon, Nov 29, 2004 at 09:10:02PM -0500, Richard Kenner wrote:
>     const_val must satisfy is_gimple_min_invariant, because it is
>     substituted into PHI nodes.  In some cases, you may be able to
>     construct a correct replacement, but in others it'll be tricky.
> 
>     I suggest
> 
> 	w = fold (build1 (VIEW_CONVERT_EXPR, ...))
> 	if (is_gimple_min_invariant (w))
> 	  ...
> 
> Well, fold doesn't do anything for VIEW_CONVERT_EXPR now unless the input
> is also a VIEW_CONVERT_EXPR, which it isn't.  So that condition will
> never be true.

The point being, that *if* you were going to be adding any code to
view convert one constant into another constant, fold would be the
place to do it.

> I thought these substitutions were for other statements, not PHI nodes?

They are for both.

> If indeed it must be a constant, then what do we record in that case,
> UNKNOWN?

VARYING.  We know what the value is, and it isn't CONSTANT.


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]