public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/114198] New: [14] RISC-V fixed-length vector -flto ICE: in vectorizable_load, at tree-vect-stmts.cc:10570
@ 2024-03-01 21:52 patrick at rivosinc dot com
  2024-03-04  9:24 ` [Bug middle-end/114198] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: patrick at rivosinc dot com @ 2024-03-01 21:52 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 114198
           Summary: [14] RISC-V fixed-length vector -flto ICE: in
                    vectorizable_load, at tree-vect-stmts.cc:10570
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: patrick at rivosinc dot com
  Target Milestone: ---

Testcase:
extern int a;
extern long b[];
char c = -61;
int d = 1198809473;
int e = -1766414329;
short f[1][13];
int g[1][13][13];
signed char h[1][13][13];
long long i[1][13][13][13], j[1][13][13][13];
unsigned k[1][13][13][13][13];
void l(char q, long r, int s, short t[][13], int u[][13][13],
       signed char v[][13][13], long long w[][13][13][13],
       long long x[][13][13][13], unsigned y[][13][13][13][13]) {
  for (int m = 0; m < 3; m = 31)
    for (unsigned n = 0; n < ({ v ? v[m][4][4] : 0; }); n += 3)
      for (int o = 0; o < s - 18446744071943137274ULL;
           o += r - 9893399894145917309ULL)
        for (unsigned p = 0; p < (unsigned char)q - 182; p += 2) {
          b[o] &= x[m][4][n][4];
          a = y[p][o][n][4][m];
        }
}
int main() { l(c, d, e, f, g, h, i, j, k); }

Backtrace:
> /scratch/tc-testing/tc-feb-20/build-rv64gcv/bin/riscv64-unknown-linux-gnu-gcc -march=rv64gcv -flto -O3 --param=riscv-autovec-preference=fixed-vlmax red.c -o red.out
during GIMPLE pass: vect
./red.c: In function 'main':
./red.c:23:5: internal compiler error: in vectorizable_load, at
tree-vect-stmts.cc:10570
   23 | int main() { l(c, d, e, f, g, h, i, j, k); }
      |     ^
0xb9a8a9 vectorizable_load
        ../../../gcc/gcc/tree-vect-stmts.cc:10570
0x2601257 vect_analyze_stmt(vec_info*, _stmt_vec_info*, bool*, _slp_tree*,
_slp_instance*, vec<stmt_info_for_cost, va_heap, vl_ptr>*)
        ../../../gcc/gcc/tree-vect-stmts.cc:13240
0x1488db2 vect_analyze_loop_operations
        ../../../gcc/gcc/tree-vect-loop.cc:2208
0x1488db2 vect_analyze_loop_2
        ../../../gcc/gcc/tree-vect-loop.cc:3041
0x148aac0 vect_analyze_loop_1
        ../../../gcc/gcc/tree-vect-loop.cc:3481
0x148b259 vect_analyze_loop(loop*, vec_info_shared*)
        ../../../gcc/gcc/tree-vect-loop.cc:3639
0x14d2ce4 try_vectorize_loop_1
        ../../../gcc/gcc/tree-vectorizer.cc:1066
0x14d2ce4 try_vectorize_loop
        ../../../gcc/gcc/tree-vectorizer.cc:1182
0x14d360c execute
        ../../../gcc/gcc/tree-vectorizer.cc:1298
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.
lto-wrapper: fatal error:
/scratch/tc-testing/tc-feb-20/build-rv64gcv/bin/riscv64-unknown-linux-gnu-gcc
returned 1 exit status
compilation terminated.
/scratch/tc-testing/tc-feb-20/build-rv64gcv/lib/gcc/riscv64-unknown-linux-gnu/14.0.1/../../../../riscv64-unknown-linux-gnu/bin/ld:
error: lto-wrapper failed
collect2: error: ld returned 1 exit status

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

Tested/found using r14-9084-g61ab046a327 (not bisected)

Found via fuzzer.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug middle-end/114198] [14] RISC-V fixed-length vector -flto ICE: in vectorizable_load, at tree-vect-stmts.cc:10570
  2024-03-01 21:52 [Bug middle-end/114198] New: [14] RISC-V fixed-length vector -flto ICE: in vectorizable_load, at tree-vect-stmts.cc:10570 patrick at rivosinc dot com
@ 2024-03-04  9:24 ` rguenth at gcc dot gnu.org
  2024-03-04 22:23 ` patrick at rivosinc dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-03-04  9:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Probably also with -fwhole-program instead of -flto

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug middle-end/114198] [14] RISC-V fixed-length vector -flto ICE: in vectorizable_load, at tree-vect-stmts.cc:10570
  2024-03-01 21:52 [Bug middle-end/114198] New: [14] RISC-V fixed-length vector -flto ICE: in vectorizable_load, at tree-vect-stmts.cc:10570 patrick at rivosinc dot com
  2024-03-04  9:24 ` [Bug middle-end/114198] " rguenth at gcc dot gnu.org
@ 2024-03-04 22:23 ` patrick at rivosinc dot com
  2024-03-11 16:30 ` patrick at rivosinc dot com
  2024-03-11 16:30 ` patrick at rivosinc dot com
  3 siblings, 0 replies; 5+ messages in thread
From: patrick at rivosinc dot com @ 2024-03-04 22:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Patrick O'Neill <patrick at rivosinc dot com> ---
(In reply to Richard Biener from comment #1)
> Probably also with -fwhole-program instead of -flto

Thanks! Updated args (--param=riscv-autovec-preference=fixed-vlmax was recently
removed):

-march=rv64gcv -fwhole-program -O3 -mrvv-vector-bits=zvl
or
-march=rv64gcv -flto -O3 -mrvv-vector-bits=zvl

Updated godbolt: https://godbolt.org/z/qb9bK61xM

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug middle-end/114198] [14] RISC-V fixed-length vector -flto ICE: in vectorizable_load, at tree-vect-stmts.cc:10570
  2024-03-01 21:52 [Bug middle-end/114198] New: [14] RISC-V fixed-length vector -flto ICE: in vectorizable_load, at tree-vect-stmts.cc:10570 patrick at rivosinc dot com
  2024-03-04  9:24 ` [Bug middle-end/114198] " rguenth at gcc dot gnu.org
  2024-03-04 22:23 ` patrick at rivosinc dot com
@ 2024-03-11 16:30 ` patrick at rivosinc dot com
  2024-03-11 16:30 ` patrick at rivosinc dot com
  3 siblings, 0 replies; 5+ messages in thread
From: patrick at rivosinc dot com @ 2024-03-11 16:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Patrick O'Neill <patrick at rivosinc dot com> ---
Fixed!

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug middle-end/114198] [14] RISC-V fixed-length vector -flto ICE: in vectorizable_load, at tree-vect-stmts.cc:10570
  2024-03-01 21:52 [Bug middle-end/114198] New: [14] RISC-V fixed-length vector -flto ICE: in vectorizable_load, at tree-vect-stmts.cc:10570 patrick at rivosinc dot com
                   ` (2 preceding siblings ...)
  2024-03-11 16:30 ` patrick at rivosinc dot com
@ 2024-03-11 16:30 ` patrick at rivosinc dot com
  3 siblings, 0 replies; 5+ messages in thread
From: patrick at rivosinc dot com @ 2024-03-11 16:30 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick O'Neill <patrick at rivosinc dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Patrick O'Neill <patrick at rivosinc dot com> ---
Fixed on tip-of-tree!

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-03-11 16:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-01 21:52 [Bug middle-end/114198] New: [14] RISC-V fixed-length vector -flto ICE: in vectorizable_load, at tree-vect-stmts.cc:10570 patrick at rivosinc dot com
2024-03-04  9:24 ` [Bug middle-end/114198] " rguenth at gcc dot gnu.org
2024-03-04 22:23 ` patrick at rivosinc dot com
2024-03-11 16:30 ` patrick at rivosinc dot com
2024-03-11 16:30 ` patrick at rivosinc dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).