https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123491
Bug ID: 123491
Summary: [16 Regression] ICE: RTL check: expected code
'const_double' and not mode 'VOID', have code
'const_int' and mode 'VOID' in
compress_float_constant, at expr.cc:4786
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: normal
Priority: P3
Component: rtl-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: zsojka at seznam dot cz
Target Milestone: ---
Host: x86_64-pc-linux-gnu
Target: i686-pc-linux-gnu
Created attachment 63290
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=63290&action=edit
reduced testcase
Compiler output:
$ x86_64-pc-linux-gnu-gcc -O2 -m32 testcase.c
during RTL pass: ce2
testcase.c: In function 'foo':
testcase.c:14:1: internal compiler error: RTL check: expected code
'const_double' and not mode 'VOID', have code 'const_int' and mode 'VOID' in
compress_float_constant, at expr.cc:4786
14 | }
| ^
0x2c87f4d internal_error(char const*, ...)
/repo/gcc-trunk/gcc/diagnostic-global-context.cc:787
0x88ce50 rtl_check_failed_code_mode(rtx_def const*, rtx_code, machine_mode,
bool, char const*, int, char const*)
/repo/gcc-trunk/gcc/rtl.cc:801
0x7dcb0c compress_float_constant
/repo/gcc-trunk/gcc/expr.cc:4786
0x7dcb0c emit_move_insn(rtx_def*, rtx_def*)
/repo/gcc-trunk/gcc/expr.cc:4716
0x112f230 copy_to_mode_reg(machine_mode, rtx_def*)
/repo/gcc-trunk/gcc/explow.cc:659
0x149219b maybe_legitimize_operand
/repo/gcc-trunk/gcc/optabs.cc:8253
0x149219b maybe_legitimize_operands(insn_code, unsigned int, unsigned int,
expand_operand*)
/repo/gcc-trunk/gcc/optabs.cc:8396
0x148e5f9 maybe_gen_insn(insn_code, unsigned int, expand_operand*)
/repo/gcc-trunk/gcc/optabs.cc:8415
0x149058c maybe_expand_insn(insn_code, unsigned int, expand_operand*)
/repo/gcc-trunk/gcc/optabs.cc:8470
0x149058c emit_conditional_move_1
/repo/gcc-trunk/gcc/optabs.cc:5403
0x1490a0a emit_conditional_move(rtx_def*, rtx_comparison, rtx_def*, rtx_def*,
machine_mode, int)
/repo/gcc-trunk/gcc/optabs.cc:5316
0x2ab669b noce_emit_cmove
/repo/gcc-trunk/gcc/ifcvt.cc:1982
0x2aba256 noce_try_cond_zero_arith
/repo/gcc-trunk/gcc/ifcvt.cc:3220
0x2abd13f noce_process_if_block
/repo/gcc-trunk/gcc/ifcvt.cc:4430
0x2abf5ba noce_find_if_block
/repo/gcc-trunk/gcc/ifcvt.cc:4904
0x2abf5ba find_if_header
/repo/gcc-trunk/gcc/ifcvt.cc:5109
0x2abf5ba if_convert
/repo/gcc-trunk/gcc/ifcvt.cc:6256
0x2ac136d execute
/repo/gcc-trunk/gcc/ifcvt.cc:6409
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.
$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-20260108142325-r16-6577-g6225251b90056f-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/16.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-20260108142325-r16-6577-g6225251b90056f-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 16.0.0 20260108 (experimental) (GCC)