https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123119
Bug ID: 123119
Summary: ICE during RTL pass in expand_fn_using_insn at
internal-fn.cc:269
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: rtl-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: rvismith1115 at gmail dot com
Target Milestone: ---
The test case is reduced by C-Reduce.
Code link: https://godbolt.org/z/4x16888Yv
$ riscv64-unknown-elf-g++ -O3 -march=rv64gcv_zvfh func.cpp
during RTL pass: expand
func.cpp: In function 'void g()':
func.cpp:5:6: internal compiler error: in expand_fn_using_insn, at
internal-fn.cc:269
5 | void g() {
| ^
0x3362f4b internal_error(char const*, ...)
/home/riscv-files/gcc-16-20251123/gcc/diagnostic-global-context.cc:787
0xe647d5 fancy_abort(char const*, int, char const*)
/home/riscv-files/gcc-16-20251123/gcc/diagnostics/context.cc:1805
0xc9c98a expand_fn_using_insn
/home/riscv-files/gcc-16-20251123/gcc/internal-fn.cc:269
0x12a9faf expand_call_stmt
/home/riscv-files/gcc-16-20251123/gcc/cfgexpand.cc:3109
0x12a9faf expand_gimple_stmt_1
/home/riscv-files/gcc-16-20251123/gcc/cfgexpand.cc:4235
0x12a9faf expand_gimple_stmt
/home/riscv-files/gcc-16-20251123/gcc/cfgexpand.cc:4382
0x12b085f expand_gimple_basic_block
/home/riscv-files/gcc-16-20251123/gcc/cfgexpand.cc:6501
0x12b28e7 execute
/home/riscv-files/gcc-16-20251123/gcc/cfgexpand.cc:7248
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.
Reproducer:
char a;
bool d;
short e;
int f;
void g() {
for (int b; b; b += 3)
for (short c = 0; c - 1; c += 3)
d |= bool(f ?: e ?: a);
}