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: Peter Osterlund <peter dot osterlund at mailbox dot swipnet dot se>
- Subject: Re: Bug in loop optimize (invalid postinc to preinc transformation)
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 28 Dec 2000 01:54:56 -0200
- Cc: David Korn <dkorn at pixelpower dot com>, "'Denis Chertykov'" <denisc at overta dot ru>, gcc at gcc dot gnu dot org
- Organization: GCC Team, Red Hat
- References: <718D38CAB6E0D011B2C90060970C28A5642545@EXCHANGESERVER><m2snn9qvov.fsf@ppro.localdomain>
On Dec 27, 2000, Peter Osterlund <peter.osterlund@mailbox.swipnet.se> wrote:
> Compiling without optimization indicates that the compiler is
> transforming (p++ < x) into (++p < (x+1)), even when not optimizing.
> This transformation is incorrect because x+1 wraps around.
Overflow invokes undefined behavior. Since incrementing p in this
case involves overflow, I think the transformation is ok, as far as
undefined behavior goes.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me