https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122051
Bug ID: 122051
Summary: ICE: in validate_change_or_fail, at
config/riscv/riscv-v.cc:6011 with
-mrvv-vector-bits=zvl -mcpu=xt-c920
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: zsojka at seznam dot cz
Target Milestone: ---
Host: x86_64-pc-linux-gnu
Target: riscv64-unknown-linux-gnu
Created attachment 62442
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=62442&action=edit
reduced testcase
Compiler output:
$ riscv64-unknown-linux-gnu-gcc -mrvv-vector-bits=zvl -mcpu=xt-c920 -Os
testcase.c
during RTL pass: vsetvl
testcase.c: In function 'foo':
testcase.c:19:1: internal compiler error: in validate_change_or_fail, at
config/riscv/riscv-v.cc:6011
19 | }
| ^
0x3377b1c internal_error(char const*, ...)
/repo/gcc-trunk/gcc/diagnostic-global-context.cc:786
0x1077eff fancy_abort(char const*, int, char const*)
/repo/gcc-trunk/gcc/diagnostics/context.cc:1803
0xd00850 riscv_vector::validate_change_or_fail(rtx_def*, rtx_def**, rtx_def*,
bool)
/repo/gcc-trunk/gcc/config/riscv/riscv-v.cc:6011
0x1dd6045 pre_vsetvl::remove_avl_operand()
/repo/gcc-trunk/gcc/config/riscv/riscv-vsetvl.cc:3501
0x1ddf98d pre_vsetvl::cleanup()
/repo/gcc-trunk/gcc/config/riscv/riscv-vsetvl.cc:3466
0x1ddf98d pass_vsetvl::lazy_vsetvl()
/repo/gcc-trunk/gcc/config/riscv/riscv-vsetvl.cc:3661
0x1de003a pass_vsetvl::execute(function*)
/repo/gcc-trunk/gcc/config/riscv/riscv-vsetvl.cc:3685
0x1de003a pass_vsetvl::execute(function*)
/repo/gcc-trunk/gcc/config/riscv/riscv-vsetvl.cc:3668
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.
$ riscv64-unknown-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-riscv64/bin/riscv64-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-20250924044126-r16-4068-ge9f3138f380676-checking-yes-rtl-df-extra-riscv64/bin/../libexec/gcc/riscv64-unknown-linux-gnu/16.0.0/lto-wrapper
Target: riscv64-unknown-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--enable-libsanitizer --with-isa-spec=2.2
--with-sysroot=/usr/riscv64-unknown-linux-gnu --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=riscv64-unknown-linux-gnu
--with-ld=/usr/bin/riscv64-unknown-linux-gnu-ld
--with-as=/usr/bin/riscv64-unknown-linux-gnu-as --disable-multilib
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-20250924044126-r16-4068-ge9f3138f380676-checking-yes-rtl-df-extra-riscv64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 16.0.0 20250924 (experimental) (GCC)