https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122656
Bug ID: 122656
Summary: RISCV: ICE during RTL pass: expand
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: ybni at cse dot cuhk.edu.hk
Target Milestone: ---
This code triggers ICE:
```c
#include "riscv_vector.h"
int a;
long b, c;
void d() { __riscv_vlseg2e32ff_v_i32mf2x2(&a, &c, b); }
```
Compile command:
```sh
riscv64-unknown-linux-gnu-gcc -march=rv64gcv -mabi=lp64d
```
Compiler Explorer: https://godbolt.org/z/TEbq69s6Y
Backtrace:
```sh
during RTL pass: expand
<source>: In function 'd':
<source>:4:12: internal compiler error: in generate_insn, at
config/riscv/riscv-vector-builtins.cc:5011
4 | void d() { __riscv_vlseg2e32ff_v_i32mf2x2(&a, &c, b); }
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0x7a1f30a29e3f __libc_start_main
???:0
```
Compiler version:
```sh
$ riscv64-unknown-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=riscv64-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/data/yunboni/utils/compilers/riscv-gcc/libexec/gcc/riscv64-unknown-linux-gnu/15.1.0/lto-wrapper
Target: riscv64-unknown-linux-gnu
Configured with:
/data/yunboni/utils/compilers/repos/riscv-gnu-toolchain/gcc/configure
--target=riscv64-unknown-linux-gnu
--prefix=/data/yunboni/utils/compilers/riscv-gcc
--with-sysroot=/data/yunboni/utils/compilers/riscv-gcc/sysroot
--with-pkgversion=g1b306039a --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=.././gcc --disable-default-pie --disable-multilib --with-abi=lp64d
--with-arch=rv64gc --with-isa-spec=20191213 'CFLAGS_FOR_TARGET=-O2
-mcmodel=medlow' 'CXXFLAGS_FOR_TARGET=-O2 -mcmodel=medlow'
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.1.0 (g1b306039a)
```