Created attachment 27036 [details] Example to reproduce the segfault gcc 4.7.0 segfaults on the attached test case when lto is used. To reproduce, please first edit the Makefile and specify a correct path to g++, then run make. This is error message that I get: /home/shared/gcc-4.7.0/bin/g++ -m32 -shared -fPIC -flto=jobserver -O3 obj/Factory.o obj/PartFactory.o -o lib.so In file included from :219:0: /home/shared/gcc-4.7.0/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/bits/stl_tree.h: In function '_ZNSt8_Rb_treeISt4pairIS0_ISsSsESt6vectorIiSaIiEEES0_IKS5_P6ObjectESt10_Select1stIS9_ESt4lessIS5_ESaIS9_EE14_M_lower_boundEPSt13_Rb_tree_nodeIS9_ESI_RS6_.isra.93.4206.constprop.221': /home/shared/gcc-4.7.0/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/bits/stl_tree.h:1093:5: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. make[1]: *** [/tmp/ccV1HG9V.ltrans1.ltrans.o] Error 1 lto-wrapper: make returned 2 exit status /home/shared/bin/ld: fatal error: lto-wrapper failed collect2: error: ld returned 1 exit status make: *** [lib.so] Error 1 The segfault happens in tree-flow-inline.h at line 562.
Dup of PR53195, and fixed. *** This bug has been marked as a duplicate of bug 53195 ***