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

            Bug ID: 116036
           Summary: [14/15] RISCV: internal compiler error: in
                    riscv_expand_mult_with_const_int with -march=rv64idv
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: patrick at rivosinc dot com
  Target Milestone: ---

Testcase:
int a[15][15];
void init() {
  for (int i_0 ; i_0 < 15 ; ++i_0)
    for (int i_1 = 0; i_1 < 15; ++i_1)
      a[i_0][i_1] = 1;
}

Command/backtrace:
> /scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/bin/riscv64-unknown-linux-gnu-gcc
>  driver.c -c -march=rv64idv -mabi=lp64d -O3
during RTL pass: expand
driver.c: In function 'init':
driver.c:5:19: internal compiler error: in riscv_expand_mult_with_const_int, at
config/riscv/riscv.cc:3033
    5 |       a[i_0][i_1] = 1;
      |       ~~~~~~~~~~~~^~~
0x2dd31f5 internal_error(char const*, ...)
        ../../../gcc/gcc/diagnostic-global-context.cc:491
0xc4b5e2 fancy_abort(char const*, int, char const*)
        ../../../gcc/gcc/diagnostic.cc:1725
0xb79bea riscv_expand_mult_with_const_int
        ../../../gcc/gcc/config/riscv/riscv.cc:3033
0xb79bea riscv_legitimize_poly_move(machine_mode, rtx_def*, rtx_def*, rtx_def*)
        ../../../gcc/gcc/config/riscv/riscv.cc:3101
0x179803e riscv_legitimize_move(machine_mode, rtx_def*, rtx_def*)
        ../../../gcc/gcc/config/riscv/riscv.cc:3244
0x1f33bc2 gen_movdi(rtx_def*, rtx_def*)
        ../../../gcc/gcc/config/riscv/riscv.md:2425
0xf41757 rtx_insn* insn_gen_fn::operator()<rtx_def*, rtx_def*>(rtx_def*,
rtx_def*) const
        ../../../gcc/gcc/recog.h:441
0xf41757 emit_move_insn_1(rtx_def*, rtx_def*)
        ../../../gcc/gcc/expr.cc:4577
0xf41b94 emit_move_insn(rtx_def*, rtx_def*)
        ../../../gcc/gcc/expr.cc:4747
0xf15ad3 copy_to_mode_reg(machine_mode, rtx_def*)
        ../../../gcc/gcc/explow.cc:659
0x120f301 maybe_legitimize_operand
        ../../../gcc/gcc/optabs.cc:8041
0x120f301 maybe_legitimize_operands(insn_code, unsigned int, unsigned int,
expand_operand*)
        ../../../gcc/gcc/optabs.cc:8184
0x120af2d maybe_gen_insn(insn_code, unsigned int, expand_operand*)
        ../../../gcc/gcc/optabs.cc:8203
0x1214589 expand_binop_directly
        ../../../gcc/gcc/optabs.cc:1457
0x1212640 expand_binop(machine_mode, optab_tag, rtx_def*, rtx_def*, rtx_def*,
int, optab_methods)
        ../../../gcc/gcc/optabs.cc:1544
0xf35c58 expand_expr_real_2(separate_ops const*, rtx_def*, machine_mode,
expand_modifier)
        ../../../gcc/gcc/expr.cc:11053
0xf40e81 expand_expr_real_gassign(gassign*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        ../../../gcc/gcc/expr.cc:11122
0xf3e242 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        ../../../gcc/gcc/expr.cc:11303
0x1494277 expand_expr(tree_node*, rtx_def*, machine_mode, expand_modifier)
        ../../../gcc/gcc/expr.h:323
0x1494277 addr_for_mem_ref(mem_address*, unsigned char, bool)
        ../../../gcc/gcc/tree-ssa-address.cc:257
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.

Godbolt: https://godbolt.org/z/Mr61Pzbe8

Found via fuzzer.

Reply via email to