https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125396
Bug ID: 125396
Summary: [16/17 Regression] ICE at -O1/2/3 during RTL pass:
expand
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: xxs_chy at outlook dot com
Target Milestone: ---
Reproducer: https://godbolt.org/z/s3TY49Ka9
Testcase:
#include <setjmp.h>
#include <stdint.h>
int8_t g7;
_Bool g13, g26;
jmp_buf g32;
void f8()
{
int32_t arr1[2];
_Bool c2, c4;
int16_t v6;
_Bool arr9[1];
int32_t sj12;
int32_t sj14;
lbl_br1:
if (g13) goto lbl_br3;
if (c4)
{
c4 = 0;
goto lbl_br6;
}
switch (v6)
case 1:
c4 = arr9;
sj14 = setjmp(g32);
g13 = sj12;
lbl_br3:
arr1[0] = 0;
sj12 = setjmp(g32);
c2 = g7;
g26 = 5;
if (c2) __builtin_unreachable();
lbl_br6:
sj12 = arr1[0];
arr1[0] = 9;
if (g26) f8();
goto lbl_br1;
}
Dump at -O1/2/3:
Unable to coalesce ssa_names 35 and 43 which are marked as MUST COALESCE.
arr1$0_35(ab) and arr1$0_43(ab)
during RTL pass: expand
<source>: In function 'f8':
<source>:6:6: internal compiler error: SSA corruption
6 | void f8()
| ^~
0x2067238 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
???:0
0x206052b internal_error(char const*, ...)
???:0
0xfafc04 coalesce_ssa_name(_var_map*)
???:0
0xf48081 rewrite_out_of_ssa(ssaexpand*)
???:0