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

--- Comment #6 from Zdenek Dvorak <rakdver at gcc dot gnu.org> 2011-04-21 
11:49:36 UTC ---
I think we rely on the assumption that pointer arithmetics satisfies the
restrictions of C standard (i.e., that the pointer is within a single memory
object) on more places than just this one.  So, if the code produced by ivopts
is indeed

for (p = &a; p != &a - 3; --p)
  *(p + 3) = ...

this could potentially cause other problems other than with alias analysis.

But, I would expect the code from ivopts to be rather

for (p = &a; ...; p = (pointer) ((unsigned) p - 1)
  *((pointer) ((unsigned) p + 3)) = ...

Which should be a valid code.  Is that the case? If so, fixing alias analysis
would be the proper solution.

Reply via email to