The following testcase fails at -O3. It succeeds at -O3 -fno-tree-fre -fno-tree-dominator-opts -fno-tree-pre
extern void abort (void); int i; int f (int *) __attribute((noinline)); int f (int *p) { int a, b; a = i; *p = 1; b = i; return a + b; } int main (void) { if (f (&i) != 1) abort (); return 0; } -- Summary: Invalid cse on aliased global variable Product: gcc Version: 4.2.3 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: amylaar at gcc dot gnu dot org GCC target triplet: arc-elf32, i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35134