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

            Bug ID: 123971
           Summary: during RTL pass: expand ICE: in require, at
                    machmode.h:323 with -O -mcpu=xt-c920
                    -mrvv-vector-bits=zvl
           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: riscv64-unknown-linux-gnu

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

Compiler output:
$ riscv64-unknown-linux-gnu-gcc -O -mcpu=xt-c920 -mrvv-vector-bits=zvl
testcase.c during RTL pass: expand
testcase.c: In function 'foo':
testcase.c:8:5: internal compiler error: in require, at machmode.h:323
    8 |   v ^= __builtin_shufflevector(u, w % 3, 4, 3, 4, 1);
      |     ^~
0x369bc3d internal_error(char const*, ...)
        /repo/gcc-trunk/gcc/diagnostic-global-context.cc:787
0x114bc49 fancy_abort(char const*, int, char const*)
        /repo/gcc-trunk/gcc/diagnostics/context.cc:1812
0xdb3660 opt_mode<machine_mode>::require() const
        /repo/gcc-trunk/gcc/machmode.h:323
0xdb4756 opt_mode<machine_mode>::require() const
        ./genrtl.h:37
0xdb4756 shuffle_merge_patterns
        /repo/gcc-trunk/gcc/config/riscv/riscv-v.cc:3514
0x1efcdc7 expand_vec_perm_const_1
        /repo/gcc-trunk/gcc/config/riscv/riscv-v.cc:4467
0x1efdfbb riscv_vector::expand_vec_perm_const(machine_mode, machine_mode,
rtx_def*, rtx_def*, rtx_def*, vec_perm_indices const&)
        /repo/gcc-trunk/gcc/config/riscv/riscv-v.cc:4539
0x1808b15 expand_vec_perm_const(machine_mode, rtx_def*, rtx_def*,
int_vector_builder<poly_int<2u, long> > const&, machine_mode, rtx_def*)
        /repo/gcc-trunk/gcc/optabs.cc:6710
0x14b7cc8 expand_expr_real_2(separate_ops const*, rtx_def*, machine_mode,
expand_modifier)
        /repo/gcc-trunk/gcc/expr.cc:11134
0x14c02e3 expand_expr_real_gassign(gassign*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        /repo/gcc-trunk/gcc/expr.cc:11353
0x14bf32d expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        /repo/gcc-trunk/gcc/expr.cc:11543
0x14ba913 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        /repo/gcc-trunk/gcc/expr.cc:12252
0x14c0335 expand_expr_real_gassign(gassign*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        /repo/gcc-trunk/gcc/expr.cc:11357
0x14bf32d expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        /repo/gcc-trunk/gcc/expr.cc:11543
0x14c9d2c expand_expr(tree_node*, rtx_def*, machine_mode, expand_modifier)
        /repo/gcc-trunk/gcc/expr.h:323
0x14c9d2c expand_operands(tree_node*, tree_node*, rtx_def*, rtx_def**,
rtx_def**, expand_modifier)
        /repo/gcc-trunk/gcc/expr.cc:9198
0x14b58ca expand_expr_real_2(separate_ops const*, rtx_def*, machine_mode,
expand_modifier)
        /repo/gcc-trunk/gcc/expr.cc:11277
0x14c02e3 expand_expr_real_gassign(gassign*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        /repo/gcc-trunk/gcc/expr.cc:11353
0x14bf32d expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        /repo/gcc-trunk/gcc/expr.cc:11543
0x14d3378 expand_expr_real(tree_node*, rtx_def*, machine_mode, expand_modifier,
rtx_def**, bool)
        /repo/gcc-trunk/gcc/expr.cc:9619
/repo/gcc-trunk/binary-trunk-20260204011633-r16-7275-gd77d64766af4aa-checking-yes-rtl-df-extra-riscv64/bin/../libexec/gcc/riscv64-unknown-linux-gnu/16.0.1/cc1
-quiet -imultilib . -iprefix
/repo/gcc-trunk/binary-trunk-20260204011633-r16-7275-gd77d64766af4aa-checking-yes-rtl-df-extra-riscv64/bin/../lib/gcc/riscv64-unknown-linux-gnu/16.0.1/
testcase.c -quiet -dumpdir a- -dumpbase testcase.c -dumpbase-ext .c
-mcpu=xt-c920 -mrvv-vector-bits=zvl
-march=rv64imafdc_zicntr_zihpm_zmmul_zaamo_zalrsc_zfh_zfhmin_zca_zcd_xtheadba_xtheadbb_xtheadbs_xtheadcmo_xtheadcondmov_xtheadfmemidx_xtheadmac_xtheadmemidx_xtheadmempair_xtheadsync_xtheadvector
-mabi=lp64d -misa-spec=2.2 -mtls-dialect=trad
-march=rv64imafdc_zicntr_zihpm_zmmul_zaamo_zalrsc_zfh_zfhmin_zca_zcd_xtheadba_xtheadbb_xtheadbs_xtheadcmo_xtheadcondmov_xtheadfmemidx_xtheadmac_xtheadmemidx_xtheadmempair_xtheadsync_xtheadvector
-O -o /tmp/ccKLez7w.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-20260204011633-r16-7275-gd77d64766af4aa-checking-yes-rtl-df-extra-riscv64/bin/../libexec/gcc/riscv64-unknown-linux-gnu/16.0.1/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-20260204011633-r16-7275-gd77d64766af4aa-checking-yes-rtl-df-extra-riscv64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 16.0.1 20260204 (experimental) (GCC)

Reply via email to