https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122991

            Bug ID: 122991
           Summary: [16 Regression] ICE: RTL check: expected code
                    'const_int', have 'reg' in gen_crc_revsisi4, at
                    config/i386/i386.md:29718 with -msse4 and
                    __builtin_rev_crc32_data32()
           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: x86_64-pc-linux-gnu

Created attachment 62984
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=62984&action=edit
reduced testcase

This might need RTL checking enabled.

Compiler output:
$ x86_64-pc-linux-gnu-gcc -msse4 testcase.c 
during RTL pass: expand
testcase.c: In function 'foo':
testcase.c:4:10: internal compiler error: RTL check: expected code 'const_int',
have 'reg' in gen_crc_revsisi4, at config/i386/i386.md:29718
    4 |   return __builtin_rev_crc32_data32 (0, 0, 0);
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0x2c9037d internal_error(char const*, ...)
        /repo/gcc-trunk/gcc/diagnostic-global-context.cc:787
0x888b4f rtl_check_failed_code1(rtx_def const*, rtx_code, char const*, int,
char const*)
        /repo/gcc-trunk/gcc/rtl.cc:770
0xa52228 gen_crc_revsisi4(rtx_def*, rtx_def*, rtx_def*, rtx_def*)
        /repo/gcc-trunk/gcc/config/i386/i386.md:29718
0x14883f8 maybe_expand_insn(insn_code, unsigned int, expand_operand*)
        /repo/gcc-trunk/gcc/optabs.cc:8465
0x14883f8 expand_insn(insn_code, unsigned int, expand_operand*)
        /repo/gcc-trunk/gcc/optabs.cc:8496
0x12d62ce expand_crc_optab_fn
        /repo/gcc-trunk/gcc/internal-fn.cc:4065
0x10074c0 expand_call_stmt
        /repo/gcc-trunk/gcc/cfgexpand.cc:3124
0x10074c0 expand_gimple_stmt_1
        /repo/gcc-trunk/gcc/cfgexpand.cc:4235
0x10074c0 expand_gimple_stmt
        /repo/gcc-trunk/gcc/cfgexpand.cc:4382
0x1009757 expand_gimple_basic_block
        /repo/gcc-trunk/gcc/cfgexpand.cc:6501
0x100bc67 execute
        /repo/gcc-trunk/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.

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-20251202065522-r16-5822-g6ae7f781322d28-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-20251202065522-r16-5822-g6ae7f781322d28-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 16.0.0 20251201 (experimental) (GCC)

Reply via email to