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

            Bug ID: 115959
           Summary: [15 Regression] rv64gcv 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:
int a;
_Bool b[307];
int main() {
  unsigned c = 40;
  for (unsigned char e = 0; e < 0307; e += 9729)
    a *= (b[e] ? 40713359501991 : 0) >= c;
}

Command/backtrace:
> /scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/bin/riscv64-unknown-linux-gnu-gcc
>  red.c -O3 -march=rv64gcv
during GIMPLE pass: vect
red.c: In function 'main':
red.c:3:5: internal compiler error: Segmentation fault
    3 | int main() {
      |     ^~~~
0x2dc5285 internal_error(char const*, ...)
        ../../../gcc/gcc/diagnostic-global-context.cc:491
0x137f503 crash_signal
        ../../../gcc/gcc/toplev.cc:319
0x745f6dc4251f ???
        ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0x1670e87 vect_create_epilog_for_reduction
        ../../../gcc/gcc/tree-vect-loop.cc:6084
0x16742e9 vectorizable_live_operation(vec_info*, _stmt_vec_info*, _slp_tree*,
_slp_instance*, int, bool, vec<stmt_info_for_cost, va_heap, vl_ptr>*)
        ../../../gcc/gcc/tree-vect-loop.cc:10900
0x161e6cd can_vectorize_live_stmts
        ../../../gcc/gcc/tree-vect-stmts.cc:13102
0x16517ff vect_transform_stmt(vec_info*, _stmt_vec_info*,
gimple_stmt_iterator*, _slp_tree*, _slp_instance*)
        ../../../gcc/gcc/tree-vect-stmts.cc:13522
0x169dd4d vect_schedule_slp_node
        ../../../gcc/gcc/tree-vect-slp.cc:9884
0x16b4c25 vect_schedule_slp_node
        ../../../gcc/gcc/tree-vect-slp.cc:9671
0x16b4c25 vect_schedule_scc
        ../../../gcc/gcc/tree-vect-slp.cc:10174
0x16b5d07 vect_schedule_slp(vec_info*, vec<_slp_instance*, va_heap, vl_ptr>
const&)
        ../../../gcc/gcc/tree-vect-slp.cc:10267
0x167ff04 vect_transform_loop(_loop_vec_info*, gimple*)
        ../../../gcc/gcc/tree-vect-loop.cc:12151
0x16c6aa1 vect_transform_loops
        ../../../gcc/gcc/tree-vectorizer.cc:1007
0x16c7213 try_vectorize_loop_1
        ../../../gcc/gcc/tree-vectorizer.cc:1153
0x16c7213 try_vectorize_loop
        ../../../gcc/gcc/tree-vectorizer.cc:1183
0x16c789c execute
        ../../../gcc/gcc/tree-vectorizer.cc:1299
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/PcfxKhr11

Found via fuzzer.

Reply via email to