Regression due to tree loop opt / expand weirdness

Zdenek Dvorak rakdver@atrey.karlin.mff.cuni.cz
Mon Oct 4 14:08:00 GMT 2004


Hello,

> >could you please explain in more detail what you mean by "wrong"?  It
> >preserves semantics of the program (unless there is some weird property
> >of pointers I am not aware of).
> 
> I'll try to answer since your timezone is more similar to mine than to 
> Richard's.
> 
> Since expr.c seemed to dislike doing operations on pointers in modes 
> different from Pmode, many people said in the other thread that your 
> optimization is not respecting some invariant that the expander expects.

expander seems to expect that pointer is first casted to integer
of the same size, and then to the target type (at least this is the way
such a cast is translated by C frontend).  This intermediate cast seems
superfluous to me (and to folder, apparently); fixing expand so that
it does not have such a weird restriction is IMHO the right way
(although it of course would not be hard to persuade fold_convert to
produce the extra cast).

Zdenek



More information about the Gcc mailing list