http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46398
Summary: early FRE miscompiles simple testcase Product: gcc Version: 4.6.0 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassig...@gcc.gnu.org ReportedBy: rgue...@gcc.gnu.org Inserting an early FRE pass after pass_sra_early causes us to miscompile the following testcase (reduced from cp/parser.c). int __attribute__((noinline)) test (int token) { int done = 0; int virtual_p = 0; while (!done) { if (token == 42) virtual_p = 1; else done = 1; } return virtual_p; } extern void abort (void); int main() { if (test (0) != 0) abort (); return 0; }