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)


<<The implementation of pointers is indeed unsigned on most machines,but
they are not "unsigned types", which would mean integral unsigned types.
So overflow is indeed undefined.
>>

Once again, this is confused.

If you increment a pointer

p++;

then this is defined only if the resulting pointer remains within the
same object, or in the csae of arrays it can go just past the end. Overflow
per se does not arise with pointers because of this stricter rule.

No optimization of pointer arithmetic can possibly be correct if it does
not preserve this fundamental semantic appearence.

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