This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/31130] [4.3 Regression] VRP no longer derives range for division after negation
- From: "ian at airs dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Mar 2007 17:21:58 -0000
- Subject: [Bug tree-optimization/31130] [4.3 Regression] VRP no longer derives range for division after negation
- References: <bug-31130-10053@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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