public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/114749] New: [14] RISC-V rv64gcv ICE: in vectorizable_load, at tree-vect-stmts.cc
@ 2024-04-16 22:54 patrick at rivosinc dot com
  2024-04-17  8:39 ` [Bug tree-optimization/114749] " rguenth at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: patrick at rivosinc dot com @ 2024-04-16 22:54 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 114749
           Summary: [14] RISC-V rv64gcv ICE: in vectorizable_load, at
                    tree-vect-stmts.cc
           Product: gcc
           Version: 14.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: ---

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

Testcase:
extern int a[];
extern char b[];
int c = 24;
_Bool d[24][24][24];
_Bool (*e)[24][24] = d;
int main() {
  for (short f = 0; f < 24; f += 3)
    for (unsigned g = 0; g < (char)c; g += 2) {
      a[f] = 0;
      b[g] |= ({ e[f][f][f]; });
    }
}

Backtrace:
> /scratch/tc-testing/tc-apr-15/build-rv64gcv/bin/riscv64-unknown-linux-gnu-gcc -march=rv64gcv -fwhole-program -O3 -mrvv-vector-bits=zvl red.c -o red.out
during GIMPLE pass: vect
./red.c: In function 'main':
./red.c:6:5: internal compiler error: in vectorizable_load, at
tree-vect-stmts.cc:10239
    6 | int main() {
      |     ^~~~
0xbd26d1 vectorizable_load
        ../../../gcc/gcc/tree-vect-stmts.cc:10239
0x26dc7b7 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:13274
0x15ec172 vect_analyze_loop_operations
        ../../../gcc/gcc/tree-vect-loop.cc:2208
0x15ec172 vect_analyze_loop_2
        ../../../gcc/gcc/tree-vect-loop.cc:3041
0x15ede80 vect_analyze_loop_1
        ../../../gcc/gcc/tree-vect-loop.cc:3481
0x15ee619 vect_analyze_loop(loop*, vec_info_shared*)
        ../../../gcc/gcc/tree-vect-loop.cc:3639
0x16362f4 try_vectorize_loop_1
        ../../../gcc/gcc/tree-vectorizer.cc:1066
0x16362f4 try_vectorize_loop
        ../../../gcc/gcc/tree-vectorizer.cc:1182
0x1636c1c 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.

Discovered/tested using r14-9976-gf8409c3109d (not bisected)

Found via fuzzer.

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

* [Bug tree-optimization/114749] [14] RISC-V rv64gcv ICE: in vectorizable_load, at tree-vect-stmts.cc
  2024-04-16 22:54 [Bug tree-optimization/114749] New: [14] RISC-V rv64gcv ICE: in vectorizable_load, at tree-vect-stmts.cc patrick at rivosinc dot com
@ 2024-04-17  8:39 ` rguenth at gcc dot gnu.org
  2024-04-17  9:30 ` cvs-commit at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-04-17  8:39 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2024-04-17
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.  We end up with a load using VMAT_ELEMENTWISE and using partial
vectors for this grouped load with single element interleaving and a
gap of 1802.

I have a fix, the issue seems latent.

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

* [Bug tree-optimization/114749] [14] RISC-V rv64gcv ICE: in vectorizable_load, at tree-vect-stmts.cc
  2024-04-16 22:54 [Bug tree-optimization/114749] New: [14] RISC-V rv64gcv ICE: in vectorizable_load, at tree-vect-stmts.cc patrick at rivosinc dot com
  2024-04-17  8:39 ` [Bug tree-optimization/114749] " rguenth at gcc dot gnu.org
@ 2024-04-17  9:30 ` cvs-commit at gcc dot gnu.org
  2024-04-17  9:31 ` [Bug tree-optimization/114749] [13 Regression] " rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-04-17  9:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:bf2b5231312e1cea45732cb8df6ffa2b2c9115b6

commit r14-10005-gbf2b5231312e1cea45732cb8df6ffa2b2c9115b6
Author: Richard Biener <rguenther@suse.de>
Date:   Wed Apr 17 10:40:04 2024 +0200

    tree-optimization/114749 - reset partial vector decision for no-SLP retry

    The following makes sure to reset LOOP_VINFO_USING_PARTIAL_VECTORS_P
    to its default of false when re-trying without SLP as otherwise
    analysis may run into bogus asserts.

            PR tree-optimization/114749
            * tree-vect-loop.cc (vect_analyze_loop_2): Reset
            LOOP_VINFO_USING_PARTIAL_VECTORS_P when re-trying without SLP.

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

* [Bug tree-optimization/114749] [13 Regression] RISC-V rv64gcv ICE: in vectorizable_load, at tree-vect-stmts.cc
  2024-04-16 22:54 [Bug tree-optimization/114749] New: [14] RISC-V rv64gcv ICE: in vectorizable_load, at tree-vect-stmts.cc patrick at rivosinc dot com
  2024-04-17  8:39 ` [Bug tree-optimization/114749] " rguenth at gcc dot gnu.org
  2024-04-17  9:30 ` cvs-commit at gcc dot gnu.org
@ 2024-04-17  9:31 ` rguenth at gcc dot gnu.org
  2024-04-17 22:09 ` juzhe.zhong at rivai dot ai
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-04-17  9:31 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |13.3
            Summary|[14] RISC-V rv64gcv ICE: in |[13 Regression] RISC-V
                   |vectorizable_load, at       |rv64gcv ICE: in
                   |tree-vect-stmts.cc          |vectorizable_load, at
                   |                            |tree-vect-stmts.cc
           Priority|P3                          |P2

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
I'm going to at least backport to 13.

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

* [Bug tree-optimization/114749] [13 Regression] RISC-V rv64gcv ICE: in vectorizable_load, at tree-vect-stmts.cc
  2024-04-16 22:54 [Bug tree-optimization/114749] New: [14] RISC-V rv64gcv ICE: in vectorizable_load, at tree-vect-stmts.cc patrick at rivosinc dot com
                   ` (2 preceding siblings ...)
  2024-04-17  9:31 ` [Bug tree-optimization/114749] [13 Regression] " rguenth at gcc dot gnu.org
@ 2024-04-17 22:09 ` juzhe.zhong at rivai dot ai
  2024-04-18  6:40 ` rguenther at suse dot de
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: juzhe.zhong at rivai dot ai @ 2024-04-17 22:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from JuzheZhong <juzhe.zhong at rivai dot ai> ---
Hi, Patrick.

It seems that Richard didn't append the testcase in the patch.
Could you send a patch to add the testcase for RISC-V port ?

Thangks.

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

* [Bug tree-optimization/114749] [13 Regression] RISC-V rv64gcv ICE: in vectorizable_load, at tree-vect-stmts.cc
  2024-04-16 22:54 [Bug tree-optimization/114749] New: [14] RISC-V rv64gcv ICE: in vectorizable_load, at tree-vect-stmts.cc patrick at rivosinc dot com
                   ` (3 preceding siblings ...)
  2024-04-17 22:09 ` juzhe.zhong at rivai dot ai
@ 2024-04-18  6:40 ` rguenther at suse dot de
  2024-05-03 13:55 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenther at suse dot de @ 2024-04-18  6:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from rguenther at suse dot de <rguenther at suse dot de> ---
On Wed, 17 Apr 2024, juzhe.zhong at rivai dot ai wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114749
> 
> --- Comment #4 from JuzheZhong <juzhe.zhong at rivai dot ai> ---
> Hi, Patrick.
> 
> It seems that Richard didn't append the testcase in the patch.
> Could you send a patch to add the testcase for RISC-V port ?

I did not because of the extra riscv specific options needed, you
may have a better idea how to correctly put that into the riscv
target specific harness (which eventually iterates over extra options?)

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

* [Bug tree-optimization/114749] [13 Regression] RISC-V rv64gcv ICE: in vectorizable_load, at tree-vect-stmts.cc
  2024-04-16 22:54 [Bug tree-optimization/114749] New: [14] RISC-V rv64gcv ICE: in vectorizable_load, at tree-vect-stmts.cc patrick at rivosinc dot com
                   ` (4 preceding siblings ...)
  2024-04-18  6:40 ` rguenther at suse dot de
@ 2024-05-03 13:55 ` cvs-commit at gcc dot gnu.org
  2024-05-03 13:57 ` rguenth at gcc dot gnu.org
  2024-05-06 21:52 ` cvs-commit at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-05-03 13:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Richard Biener
<rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:704b15e277a8792ac4cd6008ee08bec4b047a3e6

commit r13-8684-g704b15e277a8792ac4cd6008ee08bec4b047a3e6
Author: Richard Biener <rguenther@suse.de>
Date:   Wed Apr 17 10:40:04 2024 +0200

    tree-optimization/114749 - reset partial vector decision for no-SLP retry

    The following makes sure to reset LOOP_VINFO_USING_PARTIAL_VECTORS_P
    to its default of false when re-trying without SLP as otherwise
    analysis may run into bogus asserts.

            PR tree-optimization/114749
            * tree-vect-loop.cc (vect_analyze_loop_2): Reset
            LOOP_VINFO_USING_PARTIAL_VECTORS_P when re-trying without SLP.

    (cherry picked from commit bf2b5231312e1cea45732cb8df6ffa2b2c9115b6)

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

* [Bug tree-optimization/114749] [13 Regression] RISC-V rv64gcv ICE: in vectorizable_load, at tree-vect-stmts.cc
  2024-04-16 22:54 [Bug tree-optimization/114749] New: [14] RISC-V rv64gcv ICE: in vectorizable_load, at tree-vect-stmts.cc patrick at rivosinc dot com
                   ` (5 preceding siblings ...)
  2024-05-03 13:55 ` cvs-commit at gcc dot gnu.org
@ 2024-05-03 13:57 ` rguenth at gcc dot gnu.org
  2024-05-06 21:52 ` cvs-commit at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-05-03 13:57 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

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

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed as far as I am concerned.  If you can reproduce on older branches please
re-open, the backport is of course trivial.

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

* [Bug tree-optimization/114749] [13 Regression] RISC-V rv64gcv ICE: in vectorizable_load, at tree-vect-stmts.cc
  2024-04-16 22:54 [Bug tree-optimization/114749] New: [14] RISC-V rv64gcv ICE: in vectorizable_load, at tree-vect-stmts.cc patrick at rivosinc dot com
                   ` (6 preceding siblings ...)
  2024-05-03 13:57 ` rguenth at gcc dot gnu.org
@ 2024-05-06 21:52 ` cvs-commit at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-05-06 21:52 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jeff Law <law@gcc.gnu.org>:

https://gcc.gnu.org/g:4b1f128d4c25713116c7d9fd37016f7d9a112959

commit r15-216-g4b1f128d4c25713116c7d9fd37016f7d9a112959
Author: Robin Dapp <rdapp@ventanamicro.com>
Date:   Mon May 6 15:51:37 2024 -0600

    RISC-V: Add testcase for PR114749.

    this adds a test case for PR114749.
    Going to commit as obvious unless somebody complains.

    Regards
     Robin

    gcc/testsuite/ChangeLog:

            PR tree-optimization/114749

            * gcc.target/riscv/rvv/autovec/pr114749.c: New test.

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

end of thread, other threads:[~2024-05-06 21:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-16 22:54 [Bug tree-optimization/114749] New: [14] RISC-V rv64gcv ICE: in vectorizable_load, at tree-vect-stmts.cc patrick at rivosinc dot com
2024-04-17  8:39 ` [Bug tree-optimization/114749] " rguenth at gcc dot gnu.org
2024-04-17  9:30 ` cvs-commit at gcc dot gnu.org
2024-04-17  9:31 ` [Bug tree-optimization/114749] [13 Regression] " rguenth at gcc dot gnu.org
2024-04-17 22:09 ` juzhe.zhong at rivai dot ai
2024-04-18  6:40 ` rguenther at suse dot de
2024-05-03 13:55 ` cvs-commit at gcc dot gnu.org
2024-05-03 13:57 ` rguenth at gcc dot gnu.org
2024-05-06 21:52 ` cvs-commit at gcc dot gnu.org

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).