This is the mail archive of the gcc-bugs@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]

[Bug rtl-optimization/16456] PowerPC - redundant subtract involving pointer types


------- Additional Comments From nathan at gcc dot gnu dot org  2004-11-03 11:20 -------
What is happening is that convert_to_integer, which is used to convert the
subtraction result to the type of 'x', reassociates the cast from
  (int)((long)ptr1 - (long)ptr2)
to
  (int)ptr1 - (int)ptr2
As it thinks that's a win.  Unfortunately this stops CSE noticing that
the later subtraction is actually the same.

This is another example of premature tree optimization, and it should be addressed
in the reworking of fold itself.  I don't think this should be attempted at stage 3

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16456


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