https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123511
Bug ID: 123511
Summary: ICE: in emit_library_call_value_1, at calls.cc:4380
with -fcommon
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: normal
Priority: P3
Component: target
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 63305
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=63305&action=edit
reduced testcase
Compiler output:
$ riscv64-unknown-linux-gnu-gcc -fcommon testcase.c
during RTL pass: expand
testcase.c: In function 'foo':
testcase.c:4:15: internal compiler error: in emit_library_call_value_1, at
calls.cc:4380
4 | void foo() { s.c--; }
| ~^~
0x36530ad internal_error(char const*, ...)
/repo/gcc-trunk/gcc/diagnostic-global-context.cc:787
0x113503d fancy_abort(char const*, int, char const*)
/repo/gcc-trunk/gcc/diagnostics/context.cc:1805
0xbe1caf emit_library_call_value_1(int, rtx_def*, rtx_def*, libcall_type,
machine_mode, int, std::pair<rtx_def*, machine_mode>*)
/repo/gcc-trunk/gcc/calls.cc:4380
0x17f5053 emit_library_call_value(rtx_def*, rtx_def*, libcall_type,
machine_mode, rtx_def*, machine_mode)
/repo/gcc-trunk/gcc/rtl.h:4477
0x17f5053 expand_unop(machine_mode, optab_tag, rtx_def*, rtx_def*, int)
/repo/gcc-trunk/gcc/optabs.cc:3545
0x1484664 extract_integral_bit_field
/repo/gcc-trunk/gcc/expmed.cc:2098
0x148479c extract_bit_field(rtx_def*, poly_int<2u, unsigned long>, poly_int<2u,
unsigned long>, int, rtx_def*, machine_mode, machine_mode, bool, rtx_def**)
/repo/gcc-trunk/gcc/expmed.cc:2174
0x14a4053 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
/repo/gcc-trunk/gcc/expr.cc:12507
0x14a2ab5 expand_expr_real(tree_node*, rtx_def*, machine_mode, expand_modifier,
rtx_def**, bool)
/repo/gcc-trunk/gcc/expr.cc:9602
0x14a2ab5 expand_normal(tree_node*)
/repo/gcc-trunk/gcc/expr.h:329
0x14a2ab5 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
/repo/gcc-trunk/gcc/expr.cc:12894
0x149d5db expand_expr_real(tree_node*, rtx_def*, machine_mode, expand_modifier,
rtx_def**, bool)
/repo/gcc-trunk/gcc/expr.cc:9602
0x149d5db expand_expr(tree_node*, rtx_def*, machine_mode, expand_modifier)
/repo/gcc-trunk/gcc/expr.h:323
0x149d5db expand_expr_real_2(separate_ops const*, rtx_def*, machine_mode,
expand_modifier)
/repo/gcc-trunk/gcc/expr.cc:9959
0x14a2117 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
/repo/gcc-trunk/gcc/expr.cc:12948
0x14b2aab expand_expr(tree_node*, rtx_def*, machine_mode, expand_modifier)
/repo/gcc-trunk/gcc/expr.h:323
0x14b2aab store_expr(tree_node*, rtx_def*, int, bool, bool)
/repo/gcc-trunk/gcc/expr.cc:6674
0x14b5272 expand_assignment(tree_node*, tree_node*, bool)
/repo/gcc-trunk/gcc/expr.cc:6487
0x13556c1 expand_gimple_stmt_1
/repo/gcc-trunk/gcc/cfgexpand.cc:4302
0x13556c1 expand_gimple_stmt
/repo/gcc-trunk/gcc/cfgexpand.cc:4383
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-20260109124540-r16-6644-g9a2402ad31db75-checking-yes-rtl-df-extra-riscv64/bin/../libexec/gcc/riscv64-unknown-linux-gnu/16.0.0/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-20260109124540-r16-6644-g9a2402ad31db75-checking-yes-rtl-df-extra-riscv64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 16.0.0 20260108 (experimental) (GCC)