Consider static const double foo_local = 1.0; #pragma weak foo = foo_local
with unit-at-a-time we get rid of the foo_local variable (because it is unused apart form the weak decl). This is a regression from 4.0 where we correctly mark foo_local as referenced. This breaks building Xorg. rth fixed it for 4.0, somehow the bug came back. -- Summary: [4.1 Regression] #pragma weak foo = bar no longer causes bar to be referenced Product: gcc Version: 4.1.0 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P2 Component: middle-end 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=24295