https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114172
Bug ID: 114172 Summary: ICE with riscv rvv VSETVL intrinsic Product: gcc Version: 13.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: vogelm at buerokommunikation dot fernuni-hagen.de Target Milestone: --- Created attachment 57576 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57576&action=edit .i file generated from code in description #pragma riscv intrinsic "vector" void saxpy_rvv_m8(float *y, long vl) { for (;;) { vl = __riscv_vsetvl_e32m8(vl); //ICE vfloat32m8_t y_vec; __riscv_vse32_v_f32m8(y, y_vec, vl); } } Description: The attached code snipped causes an ICE on about 4 out of 10 attempts on my local machine. It seems to be related to the RVV intrinsic call __riscv_vsetvl_e32m8(vl) on line 7. Passing vl as a parameter here is a programming error, but I don't think the compiler should crash. The behavior can also be observed on godbolt (https://godbolt.org/z/Gr915shzq). I can reproduce the error on gcc 13.2.0 and 13.1.0. gcc 14.0.1 doesn't crash so there already seems to be a fix for it but I couldn't find any bug reports about it. the exact version of GCC: gcc version 13.2.0 (gc891d8dc23e) the system type: riscv64-unknown-linux-gnu the options given when GCC was configured/built; Configured with: $home/riscv-gnu-toolchain/gcc/configure --target=riscv64-unknown-linux-gnu --prefix=$home/riscv-gnu-toolchain/../_install --with-sysroot=$home/riscv-gnu-toolchain/../_install/sysroot --with-pkgversion=gc891d8dc23e --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 --enable-multilib --with-abi=lp64d --with-arch=rv64imafdcv --with-tune=rocket --with-isa-spec=20191213 'CFLAGS_FOR_TARGET=-O2 -mcmodel=medlow' 'CXXFLAGS_FOR_TARGET=-O2 -mcmodel=medlow' the complete command line that triggers the bug; riscv64-unknown-linux-gnu-gcc -march=rv64imafdcv -mabi=lp64d -O3 -static -c saxpy.c -o saxpy the compiler output (error messages, warnings, etc.) riscv64-unknown-linux-gnu-gcc: internal compiler error: Segmentation fault signal terminated program cc1