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

            Bug ID: 121073
           Summary: [16 Regression] RISC-V: ICE during RTL pass: avlprop
                    insn does not satisfy its constraints
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ewlu at rivosinc dot com
  Target Milestone: ---

Created attachment 61866
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61866&action=edit
freport-bug output

Testcase:
int a;
unsigned char p[1][21];
void init() {
  for (int s = 0; s < 21; ++s)
    for (int t = 0; t < 21; ++t)
      p[s][t] = 39;
  for (short t = 0; t < 9; t += -5077966496202321318LL + 28071)
    a = p[3][t] && p[2][t];
}

Commands/backtrace
$
/scratch/ewlu/daily-upstream-build/build-gcv/bin/riscv64-unknown-linux-gnu-gcc
-I/scratch/ewlu/ci/compiler-fuzz-ci/csmith-build/include -fsigned-char
-fno-strict-aliasing -fwrapv -march=rv64gcv -O3 -mrvv-vector-bits=zvl red.c -o
rv64gcv.out -w -freport-bug
red.c: In function 'init':
red.c:9:1: error: insn does not satisfy its constraints:
    9 | }
      | ^
(insn 23 19 25 2 (set (reg:RVVMF4QI 155)
        (if_then_else:RVVMF4QI (unspec:RVVMF32BI [
                    (reg:RVVMF32BI 136 [ mask__22.12 ])
                    (const_int 1 [0x1])
                    (const_int 2 [0x2]) repeated x2
                    (const_int 0 [0])
                    (reg:SI 66 vl)
                    (reg:SI 67 vtype)
                ] UNSPEC_VPREDICATE)
            (vec_duplicate:RVVMF4QI (const_int 39 [0x27]))
            (unspec:RVVMF4QI [
                    (reg:DI 0 zero)
                ] UNSPEC_VUNDEF))) "red.c":8:17 discrim 1 3993
{*pred_broadcastrvvmf4qi}
     (nil))
during RTL pass: avlprop
red.c:9:1: internal compiler error: in extract_constrain_insn_cached, at
recog.cc:2795
0x2ea4806 internal_error(char const*, ...)
        ../../../gcc/gcc/diagnostic-global-context.cc:517
0xd29f8b fancy_abort(char const*, int, char const*)
        ../../../gcc/gcc/diagnostic.cc:1818
0xbb1efc _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
        ../../../gcc/gcc/rtl-error.cc:108
0xbb1f28 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
        ../../../gcc/gcc/rtl-error.cc:118
0xbb0902 extract_constrain_insn_cached(rtx_insn*)
        ../../../gcc/gcc/recog.cc:2795
0x1fcf635 get_attr_avl_type_idx(rtx_insn*)
        ../../../gcc/gcc/config/riscv/riscv.md:1497
0x19f0ff4 riscv_vector::vlmax_avl_type_p(rtx_insn*)
        ../../../gcc/gcc/config/riscv/riscv-v.cc:5715
0x1a12010 vlmax_ta_p
        ../../../gcc/gcc/config/riscv/riscv-avlprop.cc:150
0x1a12010 pass_avlprop::execute(function*)
        ../../../gcc/gcc/config/riscv/riscv-avlprop.cc:465
Please submit a full bug report, with preprocessed source.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Preprocessed source stored into /tmp/cci4OIfd.out file, please attach this to
your bugreport.

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

Found via fuzzer

Reply via email to