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

            Bug ID: 117567
           Summary: [15 Regression] ICE: segfault during GIMPLE pass: vect
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: patrick at rivosinc dot com
  Target Milestone: ---

Testcase:
extern signed char a[];
long b;
signed char *c;
short *d;
int main() {
  for (int e = -63; e < 9; e += -4294967292) {
    int f_init = (b ? (8959267630 + c[e]) % 1365941252 : 0);
    for (int f = f_init; f < 9; f += 10) {
      int h = d[e + 1];
      a[e] = d[e - 2] ?: h;
    }
  }
}

Command/backtrace
> /scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/bin/riscv64-unknown-linux-gnu-gcc
>  -fwrapv -march=rv64gcv_zvl256b -O3 red.c -o rv64gcv.out
during GIMPLE pass: vect
red.c: In function 'main':
red.c:5:5: internal compiler error: Segmentation fault
    5 | int main() {
      |     ^~~~
0x2f16185 internal_error(char const*, ...)
        ../../../gcc/gcc/diagnostic-global-context.cc:518
0x13b0fd3 crash_signal
        ../../../gcc/gcc/toplev.cc:323
0x78a84cc4251f ???
        ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0x16e3078 vect_build_slp_tree_2
        ../../../gcc/gcc/tree-vect-slp.cc:2223
0x16e672b vect_build_slp_tree
        ../../../gcc/gcc/tree-vect-slp.cc:1821
0x16e1037 vect_build_slp_tree_2
        ../../../gcc/gcc/tree-vect-slp.cc:2761
0x16e672b vect_build_slp_tree
        ../../../gcc/gcc/tree-vect-slp.cc:1821
0x16e1037 vect_build_slp_tree_2
        ../../../gcc/gcc/tree-vect-slp.cc:2761
0x16e672b vect_build_slp_tree
        ../../../gcc/gcc/tree-vect-slp.cc:1821
0x16e1037 vect_build_slp_tree_2
        ../../../gcc/gcc/tree-vect-slp.cc:2761
0x16e672b vect_build_slp_tree
        ../../../gcc/gcc/tree-vect-slp.cc:1821
0x16e1037 vect_build_slp_tree_2
        ../../../gcc/gcc/tree-vect-slp.cc:2761
0x16e672b vect_build_slp_tree
        ../../../gcc/gcc/tree-vect-slp.cc:1821
0x16e1037 vect_build_slp_tree_2
        ../../../gcc/gcc/tree-vect-slp.cc:2761
0x16e672b vect_build_slp_tree
        ../../../gcc/gcc/tree-vect-slp.cc:1821
0x16e1037 vect_build_slp_tree_2
        ../../../gcc/gcc/tree-vect-slp.cc:2761
0x16e672b vect_build_slp_tree
        ../../../gcc/gcc/tree-vect-slp.cc:1821
0x16e1cda vect_build_slp_tree_2
        ../../../gcc/gcc/tree-vect-slp.cc:2088
0x16e672b vect_build_slp_tree
        ../../../gcc/gcc/tree-vect-slp.cc:1821
0x16e1037 vect_build_slp_tree_2
        ../../../gcc/gcc/tree-vect-slp.cc:2761
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/x5nTP61Tj

Tested using r15-5188-g9b2915d95d8

Found via fuzzer

Reply via email to