This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/52286] wrong code bug
- From: "regehr at cs dot utah.edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 16 Feb 2012 18:48:18 +0000
- Subject: [Bug c/52286] wrong code bug
- Auto-submitted: auto-generated
- References: <bug-52286-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52286
John Regehr <regehr at cs dot utah.edu> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |chenyang at cs dot utah.edu
--- Comment #1 from John Regehr <regehr at cs dot utah.edu> 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;
}