https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123380
Bug ID: 123380
Summary: [15/16 Regression] ICE: in gen_rtx_SUBREG, at
emit-rtl.cc:1048 with -O2 -march=rv64i -mabi=lp64 and
_Float16
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 63206
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=63206&action=edit
reduced testcase
Compiler output:
$ riscv64-unknown-linux-gnu-gcc -O2 -march=rv64i -mabi=lp64 testcase.c
during RTL pass: combine
testcase.c: In function 'foo':
testcase.c:13:1: internal compiler error: in gen_rtx_SUBREG, at
emit-rtl.cc:1048
13 | }
| ^
0x3644ced internal_error(char const*, ...)
/repo/gcc-trunk/gcc/diagnostic-global-context.cc:787
0x1133445 fancy_abort(char const*, int, char const*)
/repo/gcc-trunk/gcc/diagnostics/context.cc:1805
0xc0da1e gen_rtx_SUBREG(machine_mode, rtx_def*, poly_int<2u, unsigned long>)
/repo/gcc-trunk/gcc/emit-rtl.cc:1048
0xc0da1e gen_rtx_SUBREG(machine_mode, rtx_def*, poly_int<2u, unsigned long>)
/repo/gcc-trunk/gcc/emit-rtl.cc:1046
0x33687cb force_int_to_mode
/repo/gcc-trunk/gcc/combine.cc:9046
0x33687cb force_to_mode
/repo/gcc-trunk/gcc/combine.cc:8802
0x336fb1b make_extraction
/repo/gcc-trunk/gcc/combine.cc:7756
0x337179d make_compound_operation_int
/repo/gcc-trunk/gcc/combine.cc:8324
0x3371499 make_compound_operation(rtx_def*, rtx_code)
/repo/gcc-trunk/gcc/combine.cc:8526
0x33762b1 simplify_set
/repo/gcc-trunk/gcc/combine.cc:7030
0x337b9e7 subst
/repo/gcc-trunk/gcc/combine.cc:5660
0x337fe31 try_combine
/repo/gcc-trunk/gcc/combine.cc:3357
0x3387972 combine_instructions
/repo/gcc-trunk/gcc/combine.cc:1293
0x3387972 rest_of_handle_combine
/repo/gcc-trunk/gcc/combine.cc:15231
0x3387972 execute
/repo/gcc-trunk/gcc/combine.cc:15275
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-20260102095611-r16-6464-g254a858ae7ae14-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
--enable-libsanitizer --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
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-20260102095611-r16-6464-g254a858ae7ae14-checking-yes-rtl-df-extra-riscv64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 16.0.0 20260102 (experimental) (GCC)