http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52406
Bug #: 52406 Summary: likely wrong code bug Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassig...@gcc.gnu.org ReportedBy: reg...@cs.utah.edu regehr@john-home:~/z/reduce/1$ current-gcc -O2 small.c ; ./a.out 1 regehr@john-home:~/z/reduce/1$ current-gcc -O3 small.c ; ./a.out 0 regehr@john-home:~/z/reduce/1$ current-gcc -v Using built-in specs. COLLECT_GCC=current-gcc COLLECT_LTO_WRAPPER=/home/regehr/z/compiler-install/gcc-r184581-install/libexec/gcc/x86_64-unknown-linux-gnu/4.7.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../configure --enable-lto --prefix=/home/regehr/z/compiler-install/gcc-r184581-install --program-prefix=r184581- --enable-languages=c,c++ Thread model: posix gcc version 4.7.0 20120226 (experimental) (GCC) regehr@john-home:~/z/reduce/1$ cat small.c int printf (const char *, ...); struct { int f1; } a[2]; int *b, *const k = &a[1].f1; static int **c = &b; int e, f, d; int main () { int **l = &b; *l = k; for ( ; d <= 0; d++ ) { int *j = &e; **c = 1; *l = k; *k ^= 0; f = **l; *j = f; } printf ( "%d\n", e ); return 0; }