http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51663
Bug #: 51663 Summary: LTO does not reclaim comdat-local statics Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: normal Priority: P3 Component: lto AssignedTo: unassig...@gcc.gnu.org ReportedBy: rgue...@gcc.gnu.org CC: hubi...@gcc.gnu.org struct T; struct C { typedef ::T T; virtual void E(); static T *m () { static T *d; return d; } }; int fn () { C::m (); } int main() {} The C++ frontend with -fwhole-program reclaims C::m::d, but LTO using the linker plugin does not. See PR51650 comment #15 and #16 for some analysis.