http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46491
Summary: [4.3/4.4/4.5 Regression] ipa-pure-const.c miscompilation Product: gcc Version: 4.5.2 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P3 Component: tree-optimization AssignedTo: ja...@gcc.gnu.org ReportedBy: ja...@gcc.gnu.org extern void abort (void); __attribute__((noinline)) int foo (int *p) { int r; asm ("movl $6, (%1)\n\txorl %0, %0" : "=r" (r) : "r" (p) : "memory"); return r; } int main (void) { int p = 8; if ((foo (&p) ? : p) != 6) abort (); return 0; } is miscompiled with -O2 in 4.5 (and with -O2 -fno-ipa-reference in 4.1/4.2/4.3/4.4).