From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9489 invoked by alias); 16 Feb 2012 18:49:15 -0000 Received: (qmail 9475 invoked by uid 22791); 16 Feb 2012 18:49:15 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 16 Feb 2012 18:48:21 +0000 From: "regehr at cs dot utah.edu" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/52286] wrong code bug Date: Thu, 16 Feb 2012 18:52:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: regehr at cs dot utah.edu 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: CC Message-ID: In-Reply-To: References: 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: 2012-02/txt/msg01691.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52286 John Regehr changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |chenyang at cs dot utah.edu --- Comment #1 from John Regehr 2012-02-16 18:48:18 UTC --- [regehr@gamow 1]$ current-gcc -O0 small.c ; ./a.out 1 [regehr@gamow 1]$ current-gcc -O1 small.c ; ./a.out 0 [regehr@gamow 1]$ current-gcc -v Using built-in specs. COLLECT_GCC=current-gcc COLLECT_LTO_WRAPPER=/uusoc/exports/scratch/regehr/z/compiler-install/gcc-r184311-install/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.7.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../configure --with-libelf=/usr/local --enable-lto --prefix=/home/regehr/z/compiler-install/gcc-r184311-install --program-prefix=r184311- --enable-languages=c,c++ Thread model: posix gcc version 4.7.0 20120216 (experimental) (GCC) [regehr@gamow 1]$ cat small.c int printf ( const char *, ... ); int c, a, b; int fn1 ( void ) { return c < 0; } int main ( ) { b = ( ~a | 0 >= 0 ) & 0x98685255F; printf ( "%d\n", ( ( b ) < 0 ) ); return 0; }