https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122510
Bug ID: 122510
Summary: [16 Regression] LoongArch: ICE with -O3 during GIMPLE
pass: vect
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: xxs_chy at outlook dot com
Target Milestone: ---
Cannot reproduce on gcc-15.2 on godbolt. Looks like a recent regression.
Testcase:
#include "stdint.h"
static int32_t g_6, g_20;
int32_t *g_83;
int32_t g_3961() {
int32_t *l_3905 = &g_20;
for (; g_6; g_6 -= 1)
*l_3905 ^= *g_83;
}
Command:
> loongarch64-unknown-linux-musl-gcc -O3 reduced.c
ICE info:
during GIMPLE pass: vect
../BackSmithResult/tmp4p7_f18e/seed.c: In function 'main':
../BackSmithResult/tmp4p7_f18e/seed.c:2398:5: internal compiler error: in
require, at machmode.h:323
2398 | int main (int argc, char* argv[])
| ^~~~
0x7f104a7f9d8f __libc_start_call_main
../sysdeps/nptl/libc_start_call_main.h:58
0x7f104a7f9e3f __libc_start_main_impl
../csu/libc-start.c:392
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.
GCC version:
> loongarch64-unknown-linux-musl-gcc -v
Using built-in specs.
COLLECT_GCC=loongarch64-unknown-linux-musl-gcc
COLLECT_LTO_WRAPPER=/opt/loongarch64/bin/../libexec/gcc/loongarch64-unknown-linux-musl/16.0.0/lto-wrapper
Target: loongarch64-unknown-linux-musl
Configured with:
/home/shareduser/XChy/Projects/crosstool-ng/.build/loongarch64-unknown-linux-musl/src/gcc/configure
--build=x86_64-build_pc-linux-gnu --host=x86_64-build_pc-linux-gnu
--target=loongarch64-unknown-linux-musl
--prefix=/home/shareduser/x-tools/loongarch64-unknown-linux-musl
--exec_prefix=/home/shareduser/x-tools/loongarch64-unknown-linux-musl
--with-sysroot=/home/shareduser/x-tools/loongarch64-unknown-linux-musl/loongarch64-unknown-linux-musl/sysroot
--enable-languages=c,c++ --with-arch=loongarch64
--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/loongarch64-unknown-linux-musl/buildtools
--with-mpfr=/home/shareduser/XChy/Projects/crosstool-ng/.build/loongarch64-unknown-linux-musl/buildtools
--with-mpc=/home/shareduser/XChy/Projects/crosstool-ng/.build/loongarch64-unknown-linux-musl/buildtools
--with-isl=/home/shareduser/XChy/Projects/crosstool-ng/.build/loongarch64-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/loongarch64-unknown-linux-musl/loongarch64-unknown-linux-musl/sysroot
--enable-long-long
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 16.0.0 20251029 (experimental) (crosstool-NG 1.28.0_rc1)