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

            Bug ID: 112813
           Summary: [14 Regression] RISCV ICE: vsetvl pass: in merge at
                    config/riscv/riscv-vsetvl.cc:1968 on rv32gcv_zvl256b
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: patrick at rivosinc dot com
  Target Milestone: ---

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

> /scratch/tc-testing/tc-nov-30-trunk/build-rv64gcv/bin/riscv64-unknown-linux-gnu-gcc
>  -march=rv32gcv_zvl256b -mabi=ilp32d -O3 red.c -S -freport-bug
during RTL pass: vsetvl
red.c: In function 'k':
red.c:21:1: internal compiler error: in merge, at
config/riscv/riscv-vsetvl.cc:1968
   21 | }
      | ^
0xac3d86 demand_system::merge(vsetvl_info&, vsetvl_info const&)
        ../../../gcc/gcc/config/riscv/riscv-vsetvl.cc:1968
0xac3d86 pre_vsetvl::earliest_fuse_vsetvl_info()
        ../../../gcc/gcc/config/riscv/riscv-vsetvl.cc:2992
0x1733d79 pass_vsetvl::lazy_vsetvl()
        ../../../gcc/gcc/config/riscv/riscv-vsetvl.cc:3472
0x17340df pass_vsetvl::execute(function*)
        ../../../gcc/gcc/config/riscv/riscv-vsetvl.cc:3519
0x17340df pass_vsetvl::execute(function*)
        ../../../gcc/gcc/config/riscv/riscv-vsetvl.cc:3502
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 /scratch/tmp/ccoSwl1N.out file, please attach
this to your bugreport.

creduced testcase:
int a, c, d, f, j;
int b[7];
long e;
char *g;
int *h;
long long *i;
void k() {
  int l[][1] = {{}, {1}, {1}};
  int *m = &d, *n = &l[0][0];
  for (; e;) {
    f = 3;
    for (; f >= 0; f--) {
      *m &= b[f] >= 0;
      j = a >= 2 ? 0 : 1 >> a;
      *i |= j;
    }
    for (; c;)
      *g = 0;
  }
  h = n;
}

I've attached the -freport-bug output.

Compiler explorer: https://godbolt.org/z/G49a3P8Ef

Reply via email to