[Bug middle-end/22429] [4.1 Regression] -1073741824 <= n && n <= 1073741823 is true where n is 1073741824
pinskia at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Tue Jul 12 07:15:00 GMT 2005
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-07-12 07:04 -------
(In reply to comment #1)
> 4.0 produced:
> D.1463 = n - -1073741824;
> if (D.1463 >= 0)
>
> Which is wrong as overflow is undefined.
This shows that fold is doing something wrong:
void abort(void);
int f(int n)
{
if (n< 0)
return 1;
n+=1073741824;
return n >= 0;
}
int main()
{
if (f(1073741824))
abort ();
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22429
More information about the Gcc-bugs
mailing list