------- Comment #5 from ian at airs dot com 2007-03-12 17:21 -------
Unfortunately my patch in comment #1 doesn't handle this test case correctly:
extern void abort (void);
void
foo (int a)
{
if (a <= (int) 0x80000001)
{
a = - a;
if (a > 0)
abort ();
}
}
It turns it into if (a > 0x80000001) abort(); with no warning. The
transformation is OK with -fstrict-overflow, but we should get a warning with
-Wstrict-overflow, because it assumes that -INT_MIN > 0 is true.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31130