t1.c double i; t2.c int i; int main () { return i; }
should be accepted with -fcommon. What needs to be done is that we have to keep a list of decls per symtab entry that we might end up merging to and we need to return the proper decl when looking up the canonical decl. A warning is still appropriate here. This happens in several SPEC 2000 and SPEC 2006 benchmarks. -- Summary: LTO doesn't merge common sections properly Product: gcc Version: lto Status: UNCONFIRMED Keywords: rejects-valid Severity: normal Priority: P3 Component: lto AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: rguenth at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40903