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

            Bug ID: 127547
           Summary: [17 Regression] ICE: in spill_subreg_move, at
                    config/riscv/riscv.cc:5378 at -O1
           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: riscv64-unknown-linux-gnu

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

Compiler output:
$ riscv64-unknown-linux-gnu-gcc -O -march=rv64gv -mabi=lp64 testcase.c
during RTL pass: expand
testcase.c: In function 'foo':
testcase.c:7:1: internal compiler error: in spill_subreg_move, at
config/riscv/riscv.cc:5378
    7 | foo(W w)
      | ^~~
0x388546d internal_error(char const*, ...)
        /repo/gcc-trunk/gcc/diagnostic-global-context.cc:787
0x1184001 fancy_abort(char const*, int, char const*)
        /repo/gcc-trunk/gcc/diagnostics/context.cc:1813
0xdc6094 spill_subreg_move
        /repo/gcc-trunk/gcc/config/riscv/riscv.cc:5378
0x28dd07f gen_movti(rtx_def*, rtx_def*)
        /repo/gcc-trunk/gcc/config/riscv/riscv.md:2892
0x1501c41 rtx_insn* insn_gen_fn::operator()<rtx_def*, rtx_def*>(rtx_def*,
rtx_def*) const
        /repo/gcc-trunk/gcc/recog.h:510
0x1501c41 emit_move_ccmode
        /repo/gcc-trunk/gcc/expr.cc:4481
0x1501c41 emit_move_insn_1(rtx_def*, rtx_def*)
        /repo/gcc-trunk/gcc/expr.cc:4625
0x15020d9 emit_move_insn(rtx_def*, rtx_def*)
        /repo/gcc-trunk/gcc/expr.cc:4776
0x1501bca emit_move_complex_parts(rtx_def*, rtx_def*)
        /repo/gcc-trunk/gcc/expr.cc:4396
0x15020d9 emit_move_insn(rtx_def*, rtx_def*)
        /repo/gcc-trunk/gcc/expr.cc:4776
0x150c8c2 store_expr(tree_node*, rtx_def*, int, bool, bool)
        /repo/gcc-trunk/gcc/expr.cc:7017
0x150f76b expand_assignment(tree_node*, tree_node*, bool)
        /repo/gcc-trunk/gcc/expr.cc:6524
0x13acb01 expand_gimple_stmt_1
        /repo/gcc-trunk/gcc/cfgexpand.cc:4349
0x13acb01 expand_gimple_stmt
        /repo/gcc-trunk/gcc/cfgexpand.cc:4430
0x13aedf7 expand_gimple_basic_block
        /repo/gcc-trunk/gcc/cfgexpand.cc:6547
0x13b12e7 execute
        /repo/gcc-trunk/gcc/cfgexpand.cc:7298
/repo/gcc-trunk/binary-trunk-20260918211236-r17-4449-g4015b65b038bea-checking-yes-rtl-df-extra-riscv64/bin/../libexec/gcc/riscv64-unknown-linux-gnu/17.0.0/cc1
-quiet -iprefix
/repo/gcc-trunk/binary-trunk-20260918211236-r17-4449-g4015b65b038bea-checking-yes-rtl-df-extra-riscv64/bin/../lib/gcc/riscv64-unknown-linux-gnu/17.0.0/
testcase.c -quiet -dumpdir a- -dumpbase testcase.c -dumpbase-ext .c
-march=rv64gv -mabi=lp64 -misa-spec=2.2 -mtls-dialect=trad
-march=rv64imafdv_zmmul_zaamo_zalrsc_zve32f_zve32x_zve64d_zve64f_zve64x_zvl128b_zvl32b_zvl64b
-O -o /tmp/ccF71uhx.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.

$ 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-20260918211236-r17-4449-g4015b65b038bea-checking-yes-rtl-df-extra-riscv64/bin/../libexec/gcc/riscv64-unknown-linux-gnu/17.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
--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
--enable-libsanitizer --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-20260918211236-r17-4449-g4015b65b038bea-checking-yes-rtl-df-extra-riscv64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 17.0.0 20260918 (experimental) (GCC)

Reply via email to