https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109262
Bug ID: 109262
Summary: [13 Regression] ICE: verify_gimple failed (error:
statement marked for throw in middle of block)
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: ---
gcc 13.0.1 20230319 snapshot (g:5426ab34643d9e6502f3ee572891a03471fa33ed) ICEs
when compiling the following testcase, reduced from
gcc/testsuite/g++.dg/torture/pr88149.C, w/ -O1 -fnon-call-exceptions:
template < typename > struct au;
template < typename b > au< b > operator*(au< b >, au< b > &p2) {
au< b > ax;
ax *= p2;
return p2;
}
template <> struct au< double > {
double p() { return __real__ az; }
double q() { return __imag__ az; }
void operator*=(au &o) {
_Complex bd = o.p();
__imag__ bd = o.q();
az *= bd;
}
_Complex az;
};
long bm, m;
au< double > h;
void bn() {
for (long k; ;) {
au< double > br;
for (long j = 0; 0 < bm; ++j)
au n = br * h;
}
}
% g++-13 -O1 -fnon-call-exceptions -c a7nq8mzi.C
a7nq8mzi.C: In function 'void operator*(au<b>, au<b>&) [with b = double]':
a7nq8mzi.C:20:1: error: statement marked for throw in middle of block
20 | }
| ^
# VUSE <.MEM_1(D)>
_6 = REALPART_EXPR <p2_2(D)->az>;
during GIMPLE pass: forwprop
a7nq8mzi.C:20:1: internal compiler error: verify_gimple failed
0x123bd51 verify_gimple_in_cfg(function*, bool, bool)
/var/tmp/portage/sys-devel/gcc-13.0.1_p20230319/work/gcc-13-20230319/gcc/tree-cfg.cc:5648
0x1104820 execute_function_todo
/var/tmp/portage/sys-devel/gcc-13.0.1_p20230319/work/gcc-13-20230319/gcc/passes.cc:2098
0x1104d8e execute_todo
/var/tmp/portage/sys-devel/gcc-13.0.1_p20230319/work/gcc-13-20230319/gcc/passes.cc:2152