https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115093
Bug ID: 115093
Summary: RISC-V Vector ICE in extract_insn: unrecognizable insn
Product: gcc
Version: 15.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: jeremy.bennett at embecosm dot com
Target Milestone: ---
Bug found in SPEC CPU 2017 625.x264_s.
Reproducer (test.c):
int a;
void
c (char d[], char h[][0], char i[][4][4])
{
for (int b; b < 2; b++)
for (int e = 0; e < 4; e++)
for (int f = 0; f < 4; f++)
{
int g = e - 1;
if (d[e] || d[g])
i[b][e][f] = 2;
else if (h[0][g] || a)
i[b][e][f] = 0;
}
}
Compile with:
riscv64-unknown-linux-gnu-gcc -march=rv64gcv -mabi=lp64d -c -Ofast test.c
Output:
test.c: In function 'c':
test.c:15:1: error: unrecognizable insn:
15 | }
| ^
(insn 1200 0 0 (parallel [
(set (reg:RVVMF4QI 749 [orig:240 vect__217.22 ] [240])
(unspec:RVVMF4QI [
(reg:DI 0 zero)
] UNSPEC_VUNDEF))
(clobber (scratch:DI))
]) -1
(nil))
during RTL pass: reload
test.c:15:1: internal compiler error: in extract_insn, at recog.cc:2812
0xa95819 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
/home/jeremy/gittrees/rise-qemu/gcc/gcc/rtl-error.cc:108
0xa9583b _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
/home/jeremy/gittrees/rise-qemu/gcc/gcc/rtl-error.cc:116
0xa94117 extract_insn(rtx_insn*)
/home/jeremy/gittrees/rise-qemu/gcc/gcc/recog.cc:2812
0x10db392 ira_remove_insn_scratches(rtx_insn*, bool, _IO_FILE*, rtx_def*
(*)(rtx_def*))
/home/jeremy/gittrees/rise-qemu/gcc/gcc/ira.cc:5381
0x111df4f remove_insn_scratches
/home/jeremy/gittrees/rise-qemu/gcc/gcc/lra.cc:2154
0x111df4f lra_emit_move(rtx_def*, rtx_def*)
/home/jeremy/gittrees/rise-qemu/gcc/gcc/lra.cc:513
0x112c143 match_reload
/home/jeremy/gittrees/rise-qemu/gcc/gcc/lra-constraints.cc:1184
0x11383a4 curr_insn_transform
/home/jeremy/gittrees/rise-qemu/gcc/gcc/lra-constraints.cc:4778
0x1139c8b lra_constraints(bool)
/home/jeremy/gittrees/rise-qemu/gcc/gcc/lra-constraints.cc:5481
0x1120a52 lra(_IO_FILE*, int)
/home/jeremy/gittrees/rise-qemu/gcc/gcc/lra.cc:2442
0x10d673f do_reload
/home/jeremy/gittrees/rise-qemu/gcc/gcc/ira.cc:5973
0x10d673f execute
/home/jeremy/gittrees/rise-qemu/gcc/gcc/ira.cc:6161
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.
System information
==================
Using built-in specs.
COLLECT_GCC=riscv64-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/home/jeremy/gittrees/rise-qemu/install/libexec/gcc/riscv64-unknown-linux-gnu/15.0.0/lto-wrapper
Target: riscv64-unknown-linux-gnu
Configured with: /home/jeremy/gittrees/rise-qemu/gcc/configure
--target=riscv64-unknown-linux-gnu
--prefix=/home/jeremy/gittrees/rise-qemu/install
--with-sysroot=/home/jeremy/gittrees/rise-qemu/install/sysroot
--with-pkgversion=gbb5f619a938-dirty --with-system-zlib --enable-shared
--enable-tls --enable-languages=c,c++,fortran --disable-libmudflap
--disable-libssp --disable-libquadmath --disable-libsanitizer --disable-nls
--disable-bootstrap --src=/home/jeremy/gittrees/rise-qemu/gcc --enable-multilib
--with-abi=lp64d --with-arch=rv64gc --with-tune= --with-isa-spec=20191213
'CFLAGS_FOR_TARGET=-O2 -mcmodel=medany' 'CXXFLAGS_FOR_TARGET=-O2
-mcmodel=medany'
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240509 (experimental) (gbb5f619a938-dirty)