This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Bug in loop optimize (invalid postinc to preinc transformation)
- To: aoliva at redhat dot com, kenner at vlsi1 dot ultra dot nyu dot edu
- Subject: Re: Bug in loop optimize (invalid postinc to preinc transformation)
- From: dewar at gnat dot com (Robert Dewar)
- Date: Thu, 28 Dec 2000 08:40:26 -0500 (EST)
- Cc: gcc at gcc dot gnu dot org
<<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.