Created attachment 27177 [details] test case works with 4.6.3, fails with 4.7 (at least on x86_64-linux-gnu) $ make g++-4.7 -O2 -flto=jobserver -fwhole-program -c clua.cc -o clua.o g++-4.7 -O2 -flto=jobserver -fwhole-program -c l_global.cc -o l_global.o g++-4.7 -O2 -flto=jobserver -fwhole-program clua.o l_global.o -o /dev/null In file included from :22:0: l_global.cc: In function '_ZNSt8_Rb_treeISsSt4pairIKSs18basic_text_patternIXadL_Z15compile_patternPKcbEEXadL_Z21free_compiled_patternPvEEXadL_Z13pattern_matchS5_S4_iEEEESt10_Select1stIS7_ESt4lessISsEN9__gnu_cxx13new_allocatorIS7_EEE14_M_lower_boundEPSt13_Rb_tree_nodeIS7_ESI_RS1_.isra.12.3024.constprop.51': l_global.cc:310:169: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate.
This works on the trunk, we get undefined references. Are you using gold or BFD ld?
Confirmed. It is an ICE in set_is_used, the var annotation is NULL. Called from remove_unused_locals. This sounds somewhat familiar ...
Trunk fails for me, although not on this reduced testcase. The message says the problem is the same: In file included from :8272:0: /usr/lib/gcc-snapshot/include/c++/4.8.0/bits/stl_tree.h: In function '_ZNSt8_Rb_treeISsSt4pairIKSs18basic_text_patternIXadL_Z15compile_patternPKcbEEXadL_Z21free_compiled_patternPvEEXadL_Z13pattern_matchS5_S4_iEEEESt10_Select1stIS7_ESt4lessISsESaIS7_EE14_M_lower_boundEPSt13_Rb_tree_nodeIS7_ESG_RS1_.isra.17.794313.constprop.6959': /usr/lib/gcc-snapshot/include/c++/4.8.0/bits/stl_tree.h:1093:0: internal compiler error: Segmentation fault _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: ^ Both gold and BFD. Should I delta it again to get something that breaks on both trunk and 4.7?
Fixed on trunk, no longer reproduces on the 4.7 branch for me (rev. 188004), reproduces with branch rev. 187228. Can you re-check please?
The changelog for Debian upload which included the fix is: * Update to SVN 20120509 (r187339) from the gcc-4_7-branch. - Fix PR libstdc++/53193, PR target/53272, PR tree-optimization/53239, PR tree-optimization/53195, PR target/52999, PR target/53228, PR tree-optimization/52633, PR tree-optimization/52870, PR target/48496, PR target/53199, PR target/52684, PR lto/52605, PR plugins/53126, PR debug/53174, PR target/53187, PR tree-optimization/53144, PR c++/53186, PR fortran/53255, PR fortran/53111, PR fortran/52864. Previous one was SVN 20120502 (r187039). I'll try trunk, although with its complex build system and me being quite busy, I sadly don't promise to finish it by tonight.
Ok, works correctly on current trunk as well. Since the testcase is messy and vulnerable to small alterations, and I guess the underlying bug fixes already include a test for it, it's probably pointless to try to introduce a variant of this one. Thus, nothing more to do here. Thanks guys for the fix, let's close this one.
Fixed.