https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126666
Bug ID: 126666
Summary: [16/17 Regression] ICE at -O1 on aarch64 during GIMPLE
pass: isel
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/Mvn5WP8ax
Testcase:
#include <stdint.h>
#define BITCAST(DST_TYPE, SRC_TYPE, VALUE)
\
(union {
\
SRC_TYPE src;
\
DST_TYPE dst
\
}){ VALUE }
\
.dst
typedef int8_t v2i8 __attribute__((vector_size(2)));
typedef uint8_t v2u8 __attribute__((vector_size(2)));
_Bool g3;
__attribute__((cold)) void f12()
{
v2u8 bc6;
_Bool c10, c11;
uint8_t v17;
goto lbl_br25;
lbl_sw10:
bc6 = (v2u8)((v2i8)bc6 * bc6);
if (c11) __builtin_unreachable();
bc6 = BITCAST(v2u8, uint16_t, ~BITCAST(uint16_t, v2u8, bc6));
bc6 = ~bc6;
g3 = v17;
lbl_br25:
v17 = bc6[c10];
if (c11) __builtin_memset(0, 0, 3);
bc6 = bc6 > (v2u8){};
goto lbl_sw10;
}
Dump at -O1:
during GIMPLE pass: isel
/tmp/tmpjvcvgabd/case.c:4585:28: internal compiler error: in
gimple_expand_vec_cond_expr, at gimple-isel.cc:313
4585 | __attribute__((cold)) void f12(void* a0, uint32_t a1, _Bool a2,
uint32_t a3, uint32_t a4, uint32_t a5) {
| ^~~
0x274420d internal_error(char const*, ...)
/data/Projects/compiler-test-env/cte-work/src/gcc/gcc/diagnostic-global-context.cc:787
0xb137eb fancy_abort(char const*, int, char const*)
/data/Projects/compiler-test-env/cte-work/src/gcc/gcc/diagnostics/context.cc:1813
0x9ffff0 gimple_expand_vec_cond_expr
/data/Projects/compiler-test-env/cte-work/src/gcc/gcc/gimple-isel.cc:313
0x9ffff0 execute
/data/Projects/compiler-test-env/cte-work/src/gcc/gcc/gimple-isel.cc:1374
/data/Projects/compiler-test-env/cte-work/toolchains/gcc/aarch64-linux-musl/libexec/gcc/aarch64-linux-musl/17.0.0/cc1
-quiet /tmp/tmpjvcvgabd/case.c -mno-fix-cortex-a53-835769
-mno-fix-cortex-a53-843419 -quiet -dumpdir
/tmp/tmpjvcvgabd/prog-aarch64-armv9-a+sve-gcc-O1- -dumpbase case.c
-dumpbase-ext .c -march=armv9-a+sve -mlittle-endian -mabi=lp64 -O1 -Wall
-Wextra -Wno-unused -o /tmp/ccO6mykb.s
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.