This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/59101] New: integer wrong code bug


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)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]