http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53282
Bug #: 53282 Summary: lto and visibility-inlines-hidden makes "wrongly" hidden symbols and in a way that depends on the order of the input compilation units Classification: Unclassified Product: gcc Version: 4.7.1 Status: UNCONFIRMED Severity: blocker Priority: P3 Component: lto AssignedTo: unassig...@gcc.gnu.org ReportedBy: vincenzo.innoce...@cern.ch Target: x86_64-unknown-linux-gnu Build: gcc-4_7-branch revision 187276 Created attachment 27345 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27345 directory containing three (very similar) real-life file after pre-compiler step in the following example (not much reduced from a real-life code) a symbol, very similar to others, is made hidden for no good reason. Apparently it also depends on the order of the input files… bzip2 -d ltobug3.tar.bz2 tar -xf ltobug3.tar cd ltobug3/ c++ -fvisibility-inlines-hidden -O2 -flto -shared -fPIC -o bha.so d1.cc d2.cc d3.cc ; nm -C bha.so | grep "makeKey" | grep -v "type" 0000000000004290 t _ZN3edm10eventsetup15heterocontainer7makeKeyI11DummyRecordNS0_19EventSetupRecordKeyEEET0_v.local.77.4195 0000000000004750 W edm::eventsetup::EventSetupRecordKey edm::eventsetup::heterocontainer::makeKey<Dummy2Record, edm::eventsetup::EventSetupRecordKey>() 00000000000048a0 W edm::eventsetup::EventSetupRecordKey edm::eventsetup::heterocontainer::makeKey<DepRecord, edm::eventsetup::EventSetupRecordKey>() c++ -fvisibility-inlines-hidden -O2 -flto -shared -fPIC -o bha.so d2.cc d1.cc d3.cc ; nm -C bha.so | grep "makeKey" | grep -v "type" 00000000000048a0 W edm::eventsetup::EventSetupRecordKey edm::eventsetup::heterocontainer::makeKey<DummyRecord, edm::eventsetup::EventSetupRecordKey>() 0000000000004750 W edm::eventsetup::EventSetupRecordKey edm::eventsetup::heterocontainer::makeKey<Dummy2Record, edm::eventsetup::EventSetupRecordKey>() 00000000000049f0 W edm::eventsetup::EventSetupRecordKey edm::eventsetup::heterocontainer::makeKey<DepRecord, edm::eventsetup::EventSetupRecordKey>()