https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122321
Bug ID: 122321
Summary: [16 Regression] RISC-V rv64gcv: crash at -O0
Product: gcc
Version: 16.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: ---
Created attachment 62576
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=62576&action=edit
reproducer
The reproducer C file is attached. Looks like a recent regression as I cannot
reproduce on godbolt, whose version is gcc version 16.0.0 20251007
(experimental).
Commands:
> riscv64-unknown-linux-musl-gcc -march=rv64gcv -O0 -w reduced.c
Output:
during RTL pass: reload
a.c: In function 'ap':
a.c:145:1: internal compiler error: Segmentation fault
145 | }
| ^
0x7f9f94eda51f ???
./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0x7f9f94ec1d8f __libc_start_call_main
../sysdeps/nptl/libc_start_call_main.h:58
0x7f9f94ec1e3f __libc_start_main_impl
../csu/libc-start.c:392
Reproducible GCC version:
> riscv64-unknown-linux-musl-gcc -v
Using built-in specs.
COLLECT_GCC=riscv64-unknown-linux-musl-gcc
COLLECT_LTO_WRAPPER=/opt/riscv64/bin/../libexec/gcc/riscv64-unknown-linux-musl/16.0.0/lto-wrapper
Target: riscv64-unknown-linux-musl
Configured with:
/home/shareduser/XChy/Projects/crosstool-ng/.build/riscv64-unknown-linux-musl/src/gcc/configure
--build=x86_64-build_pc-linux-gnu --host=x86_64-build_pc-linux-gnu
--target=riscv64-unknown-linux-musl
--prefix=/home/shareduser/x-tools/riscv64-unknown-linux-musl
--exec_prefix=/home/shareduser/x-tools/riscv64-unknown-linux-musl
--with-sysroot=/home/shareduser/x-tools/riscv64-unknown-linux-musl/riscv64-unknown-linux-musl/sysroot
--enable-languages=c,c++ --with-arch=rv64gc --with-pkgversion='crosstool-NG
1.28.0_rc1' --enable-__cxa_atexit --disable-libmudflap --disable-libgomp
--disable-libssp --disable-libquadmath --disable-libquadmath-support
--disable-libsanitizer --disable-libmpx
--with-gmp=/home/shareduser/XChy/Projects/crosstool-ng/.build/riscv64-unknown-linux-musl/buildtools
--with-mpfr=/home/shareduser/XChy/Projects/crosstool-ng/.build/riscv64-unknown-linux-musl/buildtools
--with-mpc=/home/shareduser/XChy/Projects/crosstool-ng/.build/riscv64-unknown-linux-musl/buildtools
--with-isl=/home/shareduser/XChy/Projects/crosstool-ng/.build/riscv64-unknown-linux-musl/buildtools
--enable-lto --enable-threads=posix --enable-target-optspace --disable-plugin
--disable-nls --disable-multilib
--with-local-prefix=/home/shareduser/x-tools/riscv64-unknown-linux-musl/riscv64-unknown-linux-musl/sysroot
--enable-long-long
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 16.0.0 20251016 (experimental) (crosstool-NG 1.28.0_rc1)