This is the mail archive of the gcc@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: Regression due to tree loop opt / expand weirdness


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


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