https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91375
Bug ID: 91375 Summary: [8/9/10 Regression] ICE on valid code in subbinfo_with_vtable_at_offset at ipa-devirt.c:2760 since r256685 Product: gcc Version: 10.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: lto Assignee: unassigned at gcc dot gnu.org Reporter: marxin at gcc dot gnu.org CC: marxin at gcc dot gnu.org Target Milestone: --- Starting from the revision I see the following ICE: $ cat 1.ii class BDS_Mesh { virtual ~BDS_Mesh(); }; BDS_Mesh::~BDS_Mesh() {} $ cat 2.ii class BDS_Mesh { public: virtual ~BDS_Mesh(); }; void fn1() { BDS_Mesh *m = new BDS_Mesh; for (;;) delete m; } $ g++ 1.ii -c -O0 -flto -shared -fPIC && g++ 2.ii -c -O2 -flto -shared -fPIC && g++ 1.o 2.o -shared during GIMPLE pass: fre 2.ii: In function ‘fn1’: 2.ii:5:6: internal compiler error: Segmentation fault 5 | void fn1() { | ^ 0xc84b5f crash_signal /home/marxin/Programming/gcc/gcc/toplev.c:326 0x7f130c4e1e4f ??? /usr/src/debug/glibc-2.29-7.3.x86_64/signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0 0xa6fcdd tree_check(tree_node*, char const*, int, char const*, tree_code) /home/marxin/Programming/gcc/gcc/tree.h:3256 0xa6fcdd subbinfo_with_vtable_at_offset(tree_node*, unsigned long, tree_node*) /home/marxin/Programming/gcc/gcc/ipa-devirt.c:2760 0xa920b6 extr_type_from_vtbl_ptr_store /home/marxin/Programming/gcc/gcc/ipa-polymorphic-call.c:1321 0xa920b6 check_stmt_for_type_change /home/marxin/Programming/gcc/gcc/ipa-polymorphic-call.c:1522 0xd85048 walk_aliased_vdefs_1 /home/marxin/Programming/gcc/gcc/tree-ssa-alias.c:3466 0xd850ee walk_aliased_vdefs_1 /home/marxin/Programming/gcc/gcc/tree-ssa-alias.c:3449 0xd8519f walk_aliased_vdefs(ao_ref*, tree_node*, bool (*)(ao_ref*, tree_node*, void*), void*, bitmap_head**, bool*, unsigned int) /home/marxin/Programming/gcc/gcc/tree-ssa-alias.c:3488 0xa91672 ipa_polymorphic_call_context::get_dynamic_type(tree_node*, tree_node*, tree_node*, gimple*, unsigned int*) /home/marxin/Programming/gcc/gcc/ipa-polymorphic-call.c:1736 0xe3b4a2 eliminate_dom_walker::eliminate_stmt(basic_block_def*, gimple_stmt_iterator*) /home/marxin/Programming/gcc/gcc/tree-ssa-sccvn.c:5739 0xe3c61d eliminate_dom_walker::before_dom_children(basic_block_def*) /home/marxin/Programming/gcc/gcc/tree-ssa-sccvn.c:5898 0xe3c61d eliminate_dom_walker::before_dom_children(basic_block_def*) /home/marxin/Programming/gcc/gcc/tree-ssa-sccvn.c:5831 0x14b3367 dom_walker::walk(basic_block_def*) /home/marxin/Programming/gcc/gcc/domwalk.c:309 0xe350bb eliminate_with_rpo_vn(bitmap_head*) /home/marxin/Programming/gcc/gcc/tree-ssa-sccvn.c:6076 0xe44708 do_rpo_vn /home/marxin/Programming/gcc/gcc/tree-ssa-sccvn.c:7221 0xe452f8 execute /home/marxin/Programming/gcc/gcc/tree-ssa-sccvn.c:7303 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. make: *** [/tmp/cc5CSQUP.mk:2: /tmp/cc9Jtc0u.ltrans0.ltrans.o] Error 1 lto-wrapper: fatal error: make returned 2 exit status compilation terminated. /usr/bin/ld: error: lto-wrapper failed collect2: error: ld returned 1 exit status