bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GCC optimizes integer overflow: bug or feature?


From: Robert Dewar
Subject: Re: GCC optimizes integer overflow: bug or feature?
Date: Tue, 19 Dec 2006 06:46:55 -0500
User-agent: Thunderbird 1.5.0.8 (Windows/20061025)

Zdenek Dvorak wrote:

IMHO, using loops relying on the behavior of overflow of an
induction variable (*) is an ugly hack and whoever writes such a code
does not deserve for his program to work.

I suspect everyone would agree on this, and in practice I would
guess that

a) there are no programs that rely on this

b) the value of the optimization if any, is probably almost all
from this treatment of induction variables in loops.

Perhaps the proper resolution here is to implement and document
that gcc will wrap except in the case of loop variables (needs
some more careful documentation of course).




reply via email to

[Prev in Thread] Current Thread [Next in Thread]