https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107876
Bug ID: 107876 Summary: [13 Regression] ICE in verify_dominators, at dominance.cc:1184 (error: dominator of 4 should be 14, not 16) Product: gcc Version: 13.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: asolokha at gmx dot com Target Milestone: --- gfortran 13.0.0 20221120 snapshot (g:a16a5460447eaaff0b4468064e4d7b1cc8fc42eb) ICEs when compiling the following testcase, extracted from clang/testsuite/CodeGenCXX/nrvo.cpp from the clang 15 test suite, w/ -O2 -funswitch-loops --param max-unswitch-insns=2: class X { public: X(); X(const X&); X(const volatile X &); ~X(); }; X test17(int i) { if (false) { impossible: if (i == 3) return X(); } while (true) { X x; if (i == 0) return x; if (i == 1) break; if (i == 2) continue; if (i == 3) goto impossible; if (i == 4) __builtin_exit(1); if (i == 5) return x; } return X(); } % g++-13 -O2 -funswitch-loops --param max-unswitch-insns=2 -c iakwvinl.cpp iakwvinl.cpp: In function 'X test17(int)': iakwvinl.cpp:9:3: error: dominator of 4 should be 14, not 16 9 | X test17(int i) { | ^~~~~~ iakwvinl.cpp:9:3: error: dominator of 6 should be 14, not 16 iakwvinl.cpp:9:3: error: dominator of 7 should be 14, not 16 iakwvinl.cpp:9:3: error: dominator of 8 should be 14, not 16 iakwvinl.cpp:9:3: error: dominator of 10 should be 14, not 16 iakwvinl.cpp:9:3: error: dominator of 11 should be 14, not 16 iakwvinl.cpp:9:3: error: dominator of 13 should be 14, not 16 during GIMPLE pass: unswitch iakwvinl.cpp:9:3: internal compiler error: in verify_dominators, at dominance.cc:1184 0x7a0ae6 verify_dominators(cdi_direction) /var/tmp/portage/sys-devel/gcc-13.0.0_p20221120/work/gcc-13-20221120/gcc/dominance.cc:1184 0x121a869 checking_verify_dominators /var/tmp/portage/sys-devel/gcc-13.0.0_p20221120/work/gcc-13-20221120/gcc/dominance.h:76 0x121a869 cleanup_tree_cfg_noloop /var/tmp/portage/sys-devel/gcc-13.0.0_p20221120/work/gcc-13-20221120/gcc/tree-cfgcleanup.cc:1113 0x121a869 cleanup_tree_cfg(unsigned int) /var/tmp/portage/sys-devel/gcc-13.0.0_p20221120/work/gcc-13-20221120/gcc/tree-cfgcleanup.cc:1212 0x10dddac execute_function_todo /var/tmp/portage/sys-devel/gcc-13.0.0_p20221120/work/gcc-13-20221120/gcc/passes.cc:2057 0x10de20e execute_todo /var/tmp/portage/sys-devel/gcc-13.0.0_p20221120/work/gcc-13-20221120/gcc/passes.cc:2145