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]

Re: Bug in loop optimize (invalid postinc to preinc transformation)


<<Overflow of unsigned integers has defined behaviour -- they wrap.  The
question is, what rule applies to pointer comparisons?
>>

This is a malformed question. Any pointer increment is constrained 
to require that the resulting pointer be valid. Wrapping is simply
not an issue.

If p points to a valid address in an allocated array, then P+1 is also
valid, and there is no question of wrap. But P+2 may be beyond the
array and therefore ill-defined, and this has nothing to do with wrapping.


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