/* $ x86_64-unknown-linux-gnu-gcc-4.9.0 test.c -o a.out -O1 $ ./a.out @NG@ (test = 0) $ x86_64-unknown-linux-gnu-gcc-4.9.0 -v Using built-in specs. COLLECT_GCC=x86_64-unknown-linux-gnu-gcc-4.9.0 COLLECT_LTO_WRAPPER=/usr/local/x86_64-tools/gcc-4.9.0/libexec/gcc/x86_64-unknown-linux-gnu/4.9.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: /home/hassy/gcc/configure --prefix=/usr/local/x86_64-tools/gcc-4.9.0/ --with-gmp=/usr/local/gmp-5.1.1/ --with-mpfr=/usr/local/mpfr-3.1.2/ --with-mpc=/usr/local/mpc-1.0.1/ --disable-multilib --disable-nls --enable-languages=c Thread model: posix gcc version 4.9.0 20130704 (experimental) (GCC) */ #include #define OK() printf("@OK@\n") #define NG(fmt,val) printf("@NG@ (test = " fmt ")\n",val) int main (void) { volatile int k89 = 1748583847; int t0 = 1; t0 = ((int)2|(((int)-1+k89)>>(unsigned int)31U)); if (t0 == 2) { OK(); } else { NG("%d", t0); } return 0; }