http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60930
Bug ID: 60930 Summary: Wrong constant folding Product: gcc Version: 4.10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: ishiura-compiler at ml dot kwansei.ac.jp GCC 4.7 - 4.10 for i686 and x86_64 miscompiles the following code. $ cat error.c #include <stdio.h> int x = 1; main () { unsigned long long t = 0xffffffffffffffffLLU * (0xffffffffLU * x); if (t != 0xffffffff00000001LLU) { printf ("Error (t == %llu)\n", t); } return 0; } $ x86_64-unknown-linux-gnu-gcc-4.10.0 error.c -O1 $ ./a.out Error 1 $ x86_64-unknown-linux-gnu-gcc-4.10.0 -v Using built-in specs. COLLECT_GCC=x86_64-unknown-linux-gnu-gcc-4.10.0 COLLECT_LTO_WRAPPER=/usr/local/x86_64-tools/gcc-4.10.0/libexec/gcc/x86_64-unknown-linux-gnu/4.10.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: /home/hassy/gcc-master/configure --prefix=/usr/local/x86_64-tools/gcc-4.10.0/ --with-gmp=/usr/local/gmp-5.1.1/ --with-mpfr=/usr/local/mpfr-3.1.2/ --with-mpc=/usr/local/mpc-1.0.2/ --disable-multilib --disable-nls --enable-languages=c Thread model: posix gcc version 4.10.0 20140422 (experimental) (GCC) The status of the other versions are as follows: (x86_64) GCC-4.7.3 OK GCC-4.8.3 (prerelease) Error GCC-4.9.1 (prerelease) Error GCC-4.10.0 (experimental) Error (i686) GCC-4.7.3 Error GCC-4.8.3 (prerelease) Error GCC-4.9.1 (prerelease) Error GCC-4.10.0 (experimental) Error