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

            Bug ID: 124147
           Summary: ICE: SIGSEGV in emit_move_insn (expr.cc:4636) with
                    -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 63708
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=63708&action=edit
reduced testcase

Compiler output:
$ riscv64-unknown-linux-gnu-gcc -mcpu=xt-c920 -mrvv-vector-bits=zvl testcase.c
-wrapper valgrind,-q
==8667== Invalid read of size 2
==8667==    at 0x14C17ED: emit_move_insn(rtx_def*, rtx_def*) (expr.cc:4636)
==8667==    by 0x1EFF8F9: expand_vector_init_insert_elems (riscv-v.cc:1180)
==8667==    by 0x1EFF8F9: riscv_vector::expand_vec_init(rtx_def*, rtx_def*)
(riscv-v.cc:3035)
==8667==    by 0x2AF4C33: gen_vec_initrvvmf64biqi(rtx_def*, rtx_def*)
(autovec.md:426)
==8667==    by 0x14D110D: operator()<rtx_def*, rtx_def*> (recog.h:472)
==8667==    by 0x14D110D: store_constructor(tree_node*, rtx_def*, int,
poly_int<2u, long>, bool) (expr.cc:8193)
==8667==    by 0x14D5018: expand_constructor(tree_node*, rtx_def*,
expand_modifier, bool) (expr.cc:9540)
==8667==    by 0x14BE36F: expand_expr_real_1(tree_node*, rtx_def*,
machine_mode, expand_modifier, rtx_def**, bool) (expr.cc:11934)
==8667==    by 0x14CBC8D: store_expr(tree_node*, rtx_def*, int, bool, bool)
(expr.cc:6803)
==8667==    by 0x14CEC30: expand_assignment(tree_node*, tree_node*, bool)
[clone .part.0] (expr.cc:6499)
==8667==    by 0x136D731: expand_gimple_stmt_1 (cfgexpand.cc:4309)
==8667==    by 0x136D731: expand_gimple_stmt(gimple*) (cfgexpand.cc:4390)
==8667==    by 0x136FA37: expand_gimple_basic_block(basic_block_def*,
rtx_insn*) (cfgexpand.cc:6507)
==8667==    by 0x1371F27: (anonymous
namespace)::pass_expand::execute(function*) (cfgexpand.cc:7254)
==8667==    by 0x185018F: execute_one_pass(opt_pass*) (passes.cc:2656)
==8667==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==8667== 
during RTL pass: expand
testcase.c: In function 'foo':
testcase.c:6:12: internal compiler error: Segmentation fault
    6 |   return v > 0;
      |          ~~^~~
0x36a147d internal_error(char const*, ...)
        /repo/gcc-trunk/gcc/diagnostic-global-context.cc:787
0x19adc2f crash_signal
        /repo/gcc-trunk/gcc/toplev.cc:325
0x14c17ed emit_move_insn(rtx_def*, rtx_def*)
        /repo/gcc-trunk/gcc/expr.cc:4636
0x1eff8f9 expand_vector_init_insert_elems
        /repo/gcc-trunk/gcc/config/riscv/riscv-v.cc:1180
0x1eff8f9 riscv_vector::expand_vec_init(rtx_def*, rtx_def*)
        /repo/gcc-trunk/gcc/config/riscv/riscv-v.cc:3035
0x2af4c33 gen_vec_initrvvmf64biqi(rtx_def*, rtx_def*)
        /repo/gcc-trunk/gcc/config/riscv/autovec.md:426
0x14d110d rtx_insn* insn_gen_fn::operator()<rtx_def*, rtx_def*>(rtx_def*,
rtx_def*) const
        /repo/gcc-trunk/gcc/recog.h:472
0x14d110d store_constructor(tree_node*, rtx_def*, int, poly_int<2u, long>,
bool)
        /repo/gcc-trunk/gcc/expr.cc:8193
0x14d5018 expand_constructor
        /repo/gcc-trunk/gcc/expr.cc:9540
0x14be36f expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        /repo/gcc-trunk/gcc/expr.cc:11934
0x14cbc8d store_expr(tree_node*, rtx_def*, int, bool, bool)
        /repo/gcc-trunk/gcc/expr.cc:6803
0x14cec30 expand_assignment(tree_node*, tree_node*, bool)
        /repo/gcc-trunk/gcc/expr.cc:6499
0x136d731 expand_gimple_stmt_1
        /repo/gcc-trunk/gcc/cfgexpand.cc:4309
0x136d731 expand_gimple_stmt
        /repo/gcc-trunk/gcc/cfgexpand.cc:4390
0x136fa37 expand_gimple_basic_block
        /repo/gcc-trunk/gcc/cfgexpand.cc:6507
0x1371f27 execute
        /repo/gcc-trunk/gcc/cfgexpand.cc:7254
/repo/gcc-trunk/binary-trunk-20260217155659-r16-7553-g5932fb71d5ccbc-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-20260217155659-r16-7553-g5932fb71d5ccbc-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 /tmp/ccp9GxMt.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-20260217155659-r16-7553-g5932fb71d5ccbc-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-20260217155659-r16-7553-g5932fb71d5ccbc-checking-yes-rtl-df-extra-riscv64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 16.0.1 20260217 (experimental) (GCC)

Reply via email to