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

            Bug ID: 116282
           Summary: [15 Regression] RISC-V rv64id_zba_zbkb ICE: could not
                    split insn
           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:
short a;
long b;
char c, d;
void e(int f[][4][24][4], long g[][24][24][24]) {
  for (unsigned h = 2;; h = 3)
    for (long i = 0; i < 4; i = 5006368639)
      for (int j = 0; j < 4; j = 4) {
        for (long k = -4294967294; k < (c ?: f[0][2][6][j]); k += b)
          a = g[k][j][0][h];
        for (; f ? d : 0;)
          ;
      }
}

Command:
> /scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/bin/riscv64-unknown-linux-gnu-gcc
>  -O3 -march=rv64id_zba_zbkb -c -o /dev/null func.c
func.c: In function 'e':
func.c:13:1: error: could not split insn
   13 | }
      | ^
(insn 78 136 137 (parallel [
            (set (reg:DI 15 a5 [orig:196 _16 ] [196])
                (plus:DI (ashift:DI (reg/v:DI 15 a5 [orig:138 h ] [138])
                        (const_int 3 [0x3]))
                    (const_int -474989022978048 [0xfffe500000036000])))
            (clobber (reg:DI 12 a2 [213]))
        ]) 466 {*riscv.md:4340}
     (expr_list:REG_UNUSED (reg:DI 12 a2 [213])
        (nil)))
during RTL pass: final
func.c:13:1: internal compiler error: in final_scan_insn_1, at final.cc:2807
0x2de6365 internal_error(char const*, ...)
        ../../../gcc/gcc/diagnostic-global-context.cc:491
0xc50982 fancy_abort(char const*, int, char const*)
        ../../../gcc/gcc/diagnostic.cc:1772
0xae39b5 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
        ../../../gcc/gcc/rtl-error.cc:108
0xa70544 final_scan_insn_1
        ../../../gcc/gcc/final.cc:2807
0xf61b2f final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*)
        ../../../gcc/gcc/final.cc:2886
0xf61c1c final_1
        ../../../gcc/gcc/final.cc:1977
0xf627e8 rest_of_handle_final
        ../../../gcc/gcc/final.cc:4239
0xf627e8 execute
        ../../../gcc/gcc/final.cc:4317
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/9EM1fPKh7

Found via fuzzer

Reply via email to