This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/55883] New: with -fwrapv, (x < 0 && -x < 0) is assumed to be false
- From: "xi.wang at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 05 Jan 2013 03:57:08 +0000
- Subject: [Bug tree-optimization/55883] New: with -fwrapv, (x < 0 && -x < 0) is assumed to be false
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55883
Bug #: 55883
Summary: with -fwrapv, (x < 0 && -x < 0) is assumed to be false
Classification: Unclassified
Product: gcc
Version: 4.7.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: xi.wang@gmail.com
This is slightly different from Bug 22493.
#include <limits.h>
void abort ();
void f(int i)
{
if (i<0 && -i<0)
return;
abort ();
}
int main(void)
{
f(INT_MIN);
return 0;
}
The program should not abort if compiled with -fwrapv. 4.7.2 and 4.6.3 seem to
miscompile it. 4.8 is good.