http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45956
Summary: [4.6 Regression] Promoted statics conflict Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: lto AssignedTo: unassig...@gcc.gnu.org ReportedBy: rgue...@gcc.gnu.org t1.c ---- int foo (void) { static int i; return ++i; } t2.c ---- int bar (void) { static int i; return ++i; } will have same (local) mangling for i (i.1214). With -fwopr we bring both units into one with the new partitioning where they now conflict. Likely caused by my DECL_CONTEXT change which makes 2370 /* Register symbols with file or global scope to mark what input 2371 file has their definition. */ 2372 if (decl_function_context (decl) == NULL_TREE) 2373 { not the correct test in lto_register_var_decl_in_symtab.