[Bug tree-optimization/124674] New: [15/16 Regression] ICE: in require, at machmode.h:323 with -O1 and __builtin_mul_overflow()
zsojka at seznam dot cz
gcc-bugzilla@gcc.gnu.org
Sat Mar 28 08:13:16 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124674
Bug ID: 124674
Summary: [15/16 Regression] ICE: in require, at machmode.h:323
with -O1 and __builtin_mul_overflow()
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: normal
Priority: P3
Component: tree-optimization
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 64057
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=64057&action=edit
reduced testcase
Compiler output:
$ riscv64-unknown-linux-gnu-gcc -O1 testcase.c
during GIMPLE pass: ifcombine
testcase.c: In function 'foo':
testcase.c:8:6: internal compiler error: in require, at machmode.h:323
8 | void foo() { __builtin_mul_overflow(*(_Complex long *)&s.c[1] ? 1 : 0,
1, &g); }
| ^~~
0x36a7d0d internal_error(char const*, ...)
/repo/gcc-trunk/gcc/diagnostic-global-context.cc:787
0x115256d fancy_abort(char const*, int, char const*)
/repo/gcc-trunk/gcc/diagnostics/context.cc:1813
0xd00c20 opt_mode<scalar_int_mode>::require() const
/repo/gcc-trunk/gcc/machmode.h:323
0xd03267 opt_mode<scalar_int_mode>::require() const
/repo/gcc-trunk/gcc/tree.h:3935
0xd03267 layout_type(tree_node*)
/repo/gcc-trunk/gcc/stor-layout.cc:2464
0x1d68d4c build_nonstandard_integer_type(unsigned long, int)
/repo/gcc-trunk/gcc/tree.cc:7375
0x157ef6c fold_truth_andor_for_ifcombine(tree_code, tree_node*, unsigned long,
tree_code, tree_node*, tree_node*, unsigned long, tree_code, tree_node*,
tree_node*, tree_node**)
/repo/gcc-trunk/gcc/gimple-fold.cc:8723
0x1b3a0ba ifcombine_ifandif
/repo/gcc-trunk/gcc/tree-ssa-ifcombine.cc:988
0x1b3a42f tree_ssa_ifcombine_bb_1
/repo/gcc-trunk/gcc/tree-ssa-ifcombine.cc:1119
0x1b3a820 tree_ssa_ifcombine_bb
/repo/gcc-trunk/gcc/tree-ssa-ifcombine.cc:1219
0x1b3a820 execute
/repo/gcc-trunk/gcc/tree-ssa-ifcombine.cc:1412
/repo/gcc-trunk/binary-trunk-20260327111009-r16-8302-g79ef3558c8f4c5-checking-yes-rtl-df-extra-riscv64/bin/../libexec/gcc/riscv64-unknown-linux-gnu/16.0.1/cc1
-quiet -imultilib . -iprefix
/repo/gcc-trunk/binary-trunk-20260327111009-r16-8302-g79ef3558c8f4c5-checking-yes-rtl-df-extra-riscv64/bin/../lib/gcc/riscv64-unknown-linux-gnu/16.0.1/
testcase.c -quiet -dumpdir a- -dumpbase testcase.c -dumpbase-ext .c
-march=rv64imafdc_zmmul_zaamo_zalrsc_zca_zcd -mabi=lp64d -misa-spec=2.2
-mtls-dialect=trad -march=rv64imafdc_zmmul_zaamo_zalrsc_zca_zcd -O1 -o
/tmp/cc6hV5Ne.s
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-20260327111009-r16-8302-g79ef3558c8f4c5-checking-yes-rtl-df-extra-riscv64/bin/../libexec/gcc/riscv64-unknown-linux-gnu/16.0.1/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
--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
--enable-libsanitizer --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-20260327111009-r16-8302-g79ef3558c8f4c5-checking-yes-rtl-df-extra-riscv64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 16.0.1 20260327 (experimental) (GCC)
More information about the Gcc-bugs
mailing list