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

            Bug ID: 116480
           Summary: [15 Regression] ICE: in operand_subword_force, at
                    emit-rtl.cc:1824 at -O2 with
                    __builtin_stdc_has_single_bit() and _BitInt() on
                    aarch64
           Product: gcc
           Version: 15.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: aarch64-unknown-linux-gnu

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

Compiler output:
$ aarch64-unknown-linux-gnu-gcc -O2 testcase.c 
during RTL pass: expand
testcase.c: In function 'foo':
testcase.c:4:10: internal compiler error: in operand_subword_force, at
emit-rtl.cc:1824
    4 |   return __builtin_stdc_has_single_bit(b);
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0x25e580e internal_error(char const*, ...)
        /repo/gcc-trunk/gcc/diagnostic-global-context.cc:491
0xc38337 fancy_abort(char const*, int, char const*)
        /repo/gcc-trunk/gcc/diagnostic.cc:1772
0x7d8b86 operand_subword_force(rtx_def*, poly_int<2u, unsigned long>,
machine_mode)
        /repo/gcc-trunk/gcc/emit-rtl.cc:1824
0x1208289 expand_binop(machine_mode, optab_tag, rtx_def*, rtx_def*, rtx_def*,
int, optab_methods)
        /repo/gcc-trunk/gcc/optabs.cc:1750
0xf12335 emit_store_flag_int(rtx_def*, rtx_def*, rtx_code, rtx_def*, rtx_def*,
scalar_int_mode, int, int, rtx_def*)
        /repo/gcc-trunk/gcc/expmed.cc:5851
0xf11f0e emit_store_flag(rtx_def*, rtx_code, rtx_def*, rtx_def*, machine_mode,
int, int)
        /repo/gcc-trunk/gcc/expmed.cc:6196
0x1066732 expand_POPCOUNT(internal_fn, gcall*)
        /repo/gcc-trunk/gcc/internal-fn.cc:5321
0x1066732 expand_POPCOUNT(internal_fn, gcall*)
        /repo/gcc-trunk/gcc/internal-fn.cc:5293
0xde58c7 expand_call_stmt
        /repo/gcc-trunk/gcc/cfgexpand.cc:2801
0xde58c7 expand_gimple_stmt_1
        /repo/gcc-trunk/gcc/cfgexpand.cc:3962
0xde58c7 expand_gimple_stmt
        /repo/gcc-trunk/gcc/cfgexpand.cc:4104
0xdebf9e expand_gimple_basic_block
        /repo/gcc-trunk/gcc/cfgexpand.cc:6160
0xdeda66 execute
        /repo/gcc-trunk/gcc/cfgexpand.cc:6899
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.

$ aarch64-unknown-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-aarch64/bin/aarch64-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r15-3158-20240825101449-g91f549537ca-checking-yes-rtl-df-extra-aarch64/bin/../libexec/gcc/aarch64-unknown-linux-gnu/15.0.0/lto-wrapper
Target: aarch64-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-cloog --with-ppl --with-isl
--with-sysroot=/usr/aarch64-unknown-linux-gnu --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=aarch64-unknown-linux-gnu
--with-ld=/usr/bin/aarch64-unknown-linux-gnu-ld
--with-as=/usr/bin/aarch64-unknown-linux-gnu-as --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r15-3158-20240825101449-g91f549537ca-checking-yes-rtl-df-extra-aarch64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240825 (experimental) (GCC)

Reply via email to