https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127264
Bug ID: 127264
Summary: ICE: RTL check: expected code 'const_int', have 'reg'
in ix86_expand_ace_builtin, at
config/i386/i386-expand.cc:14776 with -macev1
Product: gcc
Version: 17.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: x86_64-pc-linux-gnu
Created attachment 65525
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=65525&action=edit
reduced testcase
This might need RTL checking enabled.
$ x86_64-pc-linux-gnu-gcc -macev1 testcase.c
during RTL pass: expand
testcase.c: In function 'foo':
testcase.c:1:20: internal compiler error: RTL check: expected code 'const_int',
have 'reg' in ix86_expand_ace_builtin, at config/i386/i386-expand.cc:14776
1 | void foo(char c) { __builtin_ia32_tilezero(c); }
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
0x2f0989d internal_error(char const*, ...)
/repo/gcc-trunk/gcc/diagnostic-global-context.cc:787
0x8a73e7 rtl_check_failed_code1(rtx_def const*, rtx_code, char const*, int,
char const*)
/repo/gcc-trunk/gcc/rtl.cc:771
0x9858db ix86_expand_ace_builtin
/repo/gcc-trunk/gcc/config/i386/i386-expand.cc:14776
0x11923b3 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
/repo/gcc-trunk/gcc/expr.cc:12810
0x10477c0 expand_expr(tree_node*, rtx_def*, machine_mode, expand_modifier)
/repo/gcc-trunk/gcc/expr.h:323
0x10477c0 expand_call_stmt
/repo/gcc-trunk/gcc/cfgexpand.cc:3242
0x10477c0 expand_gimple_stmt_1
/repo/gcc-trunk/gcc/cfgexpand.cc:4280
0x10477c0 expand_gimple_stmt
/repo/gcc-trunk/gcc/cfgexpand.cc:4427
0x1048f67 expand_gimple_basic_block
/repo/gcc-trunk/gcc/cfgexpand.cc:6544
0x104b487 execute
/repo/gcc-trunk/gcc/cfgexpand.cc:7295
/repo/gcc-trunk/binary-trunk-20260908061028-r17-3982-g3adc17073b38eb-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/17.0.0/cc1
-quiet -iprefix
/repo/gcc-trunk/binary-trunk-20260908061028-r17-3982-g3adc17073b38eb-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../lib/gcc/x86_64-pc-linux-gnu/17.0.0/
testcase.c -quiet -dumpdir a- -dumpbase testcase.c -dumpbase-ext .c -macev1
-mtune=generic -march=x86-64 -o /tmp/ccLvVm9r.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.
$ x86_64-pc-linux-gnu-gcc -macev1 testcase.c
x86_64-pc-linux-gnu-gcc: error: unrecognized command-line option '-macev1'
smatz@bravo17 ~/gcc-bug/1352 $
/repo/gcc-trunk/binary-latest-amd64/bin/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-20260908061028-r17-3982-g3adc17073b38eb-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/17.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-20260908061028-r17-3982-g3adc17073b38eb-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 17.0.0 20260908 (experimental) (GCC)