https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64043
Markus Trippelsdorf <trippels at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2014-11-24 CC| |trippels at gcc dot gnu.org Target Milestone|--- |5.0 Ever confirmed|0 |1 --- Comment #1 from Markus Trippelsdorf <trippels at gcc dot gnu.org> --- This is a case of -O0 vs -O2 (during final link): Further reduced: markus@x4 testcase % cat one.ii class Validator { public: virtual ~Validator (); }; class FooWriter { Validator *validator; ~FooWriter (); }; FooWriter::~FooWriter () { delete validator; } markus@x4 testcase % g++ -flto -std=c++11 -c one.ii markus@x4 testcase % g++ -r -nostdlib -O2 -flto one.o one.ii: In member function ‘__base_dtor ’: one.ii:11:1: internal compiler error: Segmentation fault FooWriter::~FooWriter () { delete validator; } ^ 0x9dc45f crash_signal ../../gcc/gcc/toplev.c:359 0xc3f211 tree_check ../../gcc/gcc/tree.h:2758 0xc3f211 get_binfo_at_offset(tree_node*, long, tree_node*) ../../gcc/gcc/tree.c:11914 0x82855b possible_polymorphic_call_targets(tree_node*, long, ipa_polymorphic_call_context, bool*, void**, bool) ../../gcc/gcc/ipa-devirt.c:2404 0x792a2f possible_polymorphic_call_targets(tree_node*, gimple_statement_base*, bool*, void**) ../../gcc/gcc/ipa-utils.h:126 0x790c4a gimple_fold_call ../../gcc/gcc/gimple-fold.c:2667 0x790c4a fold_stmt_1 ../../gcc/gcc/gimple-fold.c:3246 0xafb1a3 execute ../../gcc/gcc/tree-ssa-forwprop.c:2228 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <http://gcc.gnu.org/bugs.html> for instructions. lto-wrapper: fatal error: /var/tmp/gcc_test/usr/local/bin/g++ returned 1 exit status compilation terminated. /usr/bin/ld: fatal error: lto-wrapper failed collect2: error: ld returned 1 exit status