From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20588 invoked by alias); 5 Jan 2013 03:57:36 -0000 Received: (qmail 20223 invoked by uid 48); 5 Jan 2013 03:57:09 -0000 From: "xi.wang at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/55883] New: with -fwrapv, (x < 0 && -x < 0) is assumed to be false Date: Sat, 05 Jan 2013 03:57:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: xi.wang at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2013-01/txt/msg00358.txt.bz2 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 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.