[Bug c/30475] assert(int+100 > int) optimized away
pinskia at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Sun Jan 21 08:58:00 GMT 2007
------- Comment #30 from pinskia at gcc dot gnu dot org 2007-01-21 08:58 -------
GCC is not going to change. There is no reason why you can't either use
-fwrapv or change the security checks to be before the overflow happens. There
are now good reasons why -fwrapv is not on by default, if you look at:
int f(int max, int *t)
{
int i;
for(i = 0;i<=max;i++)
{
if (i<0) return 1;
t[i]++;
}
return 0;
}
The "if (i<0)" should always be removed as i can never be negative.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |WONTFIX
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30475
More information about the Gcc-bugs
mailing list