[Bug c/59101] New: integer wrong code bug
regehr at cs dot utah.edu
gcc-bugzilla@gcc.gnu.org
Wed Nov 13 05:59:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59101
Bug ID: 59101
Summary: integer wrong code bug
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: regehr at cs dot utah.edu
$ gcc -O0 foo.c ; ./a.out
7
$ gcc -O1 foo.c ; ./a.out
6
$ cat foo.c
int printf(const char *, ...);
int a, b;
int main() {
b = (~a & 4102790424) > 0 | 6;
printf("%d\n", b);
return 0;
}
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/home/regehr/z/compiler-install/gcc-r204695-install/libexec/gcc/x86_64-unknown-linux-gnu/4.9.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /home/regehr/z/compiler-source/gcc/configure
--prefix=/home/regehr/z/compiler-install/gcc-r204695-install
--enable-languages=c,c++ --enable-multilib
Thread model: posix
gcc version 4.9.0 20131112 (experimental) (GCC)
More information about the Gcc-bugs
mailing list