https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125696
Bug ID: 125696
Summary: [17 Regression] ICE at -O2/3 during GIMPLE pass: fre
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: xxs_chy at outlook dot com
Target Milestone: ---
Reproducer: https://godbolt.org/z/5KxoEr738
Testcase:
#include <stdint.h>
typedef int16_t v2i16 __attribute__((vector_size(4)));
_Bool g1, g18;
void g28()
{
v2i16 vec0;
int32_t v4;
int32_t v5;
void *p7 = &v4;
v5 = __builtin_clrsb(v4);
g18 = 0;
lbl_br6:
*(int32_t *)p7 = 0;
int32_t bb9 = -v5;
if (g18) goto lbl_b65;
do bb9 = __builtin_clz(bb9);
while (bb9);
switch ((int32_t)v5)
case 65:
case 7033:
goto lbl_b65;
p7 = &vec0;
g18 = 6;
goto lbl_br6;
lbl_b65:
vec0[0] = 0;
g1 = *(int8_t *)p7;
}
Dump at -O2/3:
<source>: In function 'g28':
<source>:4:6: error: invalid expression for min lvalue
4 | void g28()
| ^~~
_27 = VIEW_CONVERT_EXPR<short int>({});
during GIMPLE pass: fre
<source>:4:6: internal compiler error: verify_gimple failed
0x2669a78 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
???:0
0x265e6bb internal_error(char const*, ...)
???:0
0x124d1be verify_gimple_in_cfg(function*, bool, bool)
???:0