https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126463
Bug ID: 126463
Summary: [15/16/17 Regression] ICE at -O1 on aarch64 during RTL
pass: final
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/aWqzzs4cs
Testcase:
#include <stdint.h>
#define BITCAST(DST_TYPE, SRC_TYPE, VALUE)
\
(union {
\
SRC_TYPE src;
\
DST_TYPE dst
\
}){ VALUE }
\
.dst
typedef int8_t v8i8;
int32_t g9;
void *g18, *g30;
void f6(void *, void *, _Bool, int8_t, int64_t, int64_t)
{
_Bool a1, ob2;
int32_t ov3;
ob2 = __builtin_sub_overflow(0, g9, &ov3);
if (ob2) g30 = 0;
v8i8 bc5;
int64_t bc9;
int64_t ov11;
int64_t v12;
bc9 = BITCAST(int64_t, v8i8, bc5);
if (ov11 == 0)
{
a1 = __builtin_sub_overflow(0, bc9, &v12);
f6(g30, g18, a1, 0, v12, 0);
}
}
Dump at -O1:
during RTL pass: final
/tmp/tmp_2k12eyc/case.c: In function 'f5':
/tmp/tmp_2k12eyc/case.c:3245:1: internal compiler error: output_operand:
operand number missing after %-letter
3245 | }
| ^
0x27248cd internal_error(char const*, ...)
/data/Projects/compiler-test-env/cte-work/src/gcc/gcc/diagnostic-global-context.cc:787
0xe5efb3 output_operand_lossage(char const*, ...)
/data/Projects/compiler-test-env/cte-work/src/gcc/gcc/final.cc:3206
0xe5fd23 output_asm_insn(char const*, rtx_def**)
/data/Projects/compiler-test-env/cte-work/src/gcc/gcc/final.cc:3521
0xe63987 output_asm_insn(char const*, rtx_def**)
/data/Projects/compiler-test-env/cte-work/src/gcc/gcc/final.cc:3441
0xe63987 final_scan_insn_1
/data/Projects/compiler-test-env/cte-work/src/gcc/gcc/final.cc:2856
0xe63d2b final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*)
/data/Projects/compiler-test-env/cte-work/src/gcc/gcc/final.cc:2902
0xe63f52 final_1
/data/Projects/compiler-test-env/cte-work/src/gcc/gcc/final.cc:1984
0xe64a4f rest_of_handle_final
/data/Projects/compiler-test-env/cte-work/src/gcc/gcc/final.cc:4272
0xe64a4f execute
/data/Projects/compiler-test-env/cte-work/src/gcc/gcc/final.cc:4350
/data/Projects/compiler-test-env/cte-work/toolchains/gcc/aarch64-linux-musl/libexec/gcc/aarch64-linux-musl/17.0.0/cc1
-quiet /tmp/tmp_2k12eyc/case.c -mno-fix-cortex-a53-835769
-mno-fix-cortex-a53-843419 -quiet -dumpdir
/tmp/tmp_2k12eyc/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/ccVbrST1.s