public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/111136] New: ICE in RISC-V test case since r14-3441-ga1558e9ad85693
@ 2023-08-24 14:49 rdapp at gcc dot gnu.org
  2023-08-25  3:35 ` [Bug tree-optimization/111136] " juzhe.zhong at rivai dot ai
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: rdapp at gcc dot gnu.org @ 2023-08-24 14:49 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 111136
           Summary: ICE in RISC-V test case since r14-3441-ga1558e9ad85693
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rdapp at gcc dot gnu.org
  Target Milestone: ---
            Target: riscv

The following RISC-V test case ICEs since r14-3441-ga1558e9ad85693
(mask_gather_load-11.c)

#define uint8_t unsigned char

void
foo (uint8_t *restrict y, uint8_t *restrict x,
     uint8_t *index,
     uint8_t *cond)
{
  for (int i = 0; i < 100; ++i)
    {
      if (cond[i * 2])
        y[i * 2] = x[index[i * 2]] + 1;
      if (cond[i * 2 + 1])
        y[i * 2 + 1] = x[index[i * 2 + 1]] + 2;
    }
}

I compiled with
build/gcc/cc1 -march=rv64gcv -mabi=lp64 -O3
--param=riscv-autovec-preference=scalable mask_gather_load-11.c

mask_gather_load-11.c: In function 'foo':
mask_gather_load-11.c:9:1: internal compiler error: in
get_group_load_store_type, at tree-vect-stmts.cc:2121
    9 | foo (uint8_t *restrict y, uint8_t *restrict x,
      | ^~~
0x9e2fad get_group_load_store_type
        ../../gcc/tree-vect-stmts.cc:2121
0x9e2fad get_load_store_type
        ../../gcc/tree-vect-stmts.cc:2451
0x1ff7221 vectorizable_store
        ../../gcc/tree-vect-stmts.cc:8309
[...]

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

* [Bug tree-optimization/111136] ICE in RISC-V test case since r14-3441-ga1558e9ad85693
  2023-08-24 14:49 [Bug tree-optimization/111136] New: ICE in RISC-V test case since r14-3441-ga1558e9ad85693 rdapp at gcc dot gnu.org
@ 2023-08-25  3:35 ` juzhe.zhong at rivai dot ai
  2023-08-25  7:16 ` rguenth at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: juzhe.zhong at rivai dot ai @ 2023-08-25  3:35 UTC (permalink / raw)
  To: gcc-bugs

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

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

It faild at RISC-V scatter store cases:

When trying to generate gimple build:

...
.MASK_LEN_SCATTER_STORE (vectp_y.28_130, { 0, 2, 4, ... }, 1, vect__25.27_127,
mask__26.20_117, _135, 0);
...

ICE at:
  /* Stores can't yet have gaps.  */
  gcc_assert (slp_node || vls_type == VLS_LOAD || gap == 0);

in vectorizable_store.


Since slp_node is null and vls_type == VLS_STORE and gap == 1
Then assertion failed.

I change it into:
  gcc_assert (slp_node || vls_type == VLS_LOAD || vls_type == VLS_STORE
              || gap == 0);

It passed.

I am not sure it's the correct fix since I saw a comment here:

  /* Stores can't yet have gaps.  */
Means that we should not have scatter store here?

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

* [Bug tree-optimization/111136] ICE in RISC-V test case since r14-3441-ga1558e9ad85693
  2023-08-24 14:49 [Bug tree-optimization/111136] New: ICE in RISC-V test case since r14-3441-ga1558e9ad85693 rdapp at gcc dot gnu.org
  2023-08-25  3:35 ` [Bug tree-optimization/111136] " juzhe.zhong at rivai dot ai
@ 2023-08-25  7:16 ` rguenth at gcc dot gnu.org
  2023-08-25  7:42 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-08-25  7:16 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2023-08-25
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org
             Status|UNCONFIRMED                 |ASSIGNED

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
I will have a look.

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

* [Bug tree-optimization/111136] ICE in RISC-V test case since r14-3441-ga1558e9ad85693
  2023-08-24 14:49 [Bug tree-optimization/111136] New: ICE in RISC-V test case since r14-3441-ga1558e9ad85693 rdapp at gcc dot gnu.org
  2023-08-25  3:35 ` [Bug tree-optimization/111136] " juzhe.zhong at rivai dot ai
  2023-08-25  7:16 ` rguenth at gcc dot gnu.org
@ 2023-08-25  7:42 ` rguenth at gcc dot gnu.org
  2023-08-25  7:51 ` rdapp at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-08-25  7:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
A similar aarch64 ICE is fixed with the following:

diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc
index ebee8037e02..23c6e8259e7 100644
--- a/gcc/tree-vect-loop.cc
+++ b/gcc/tree-vect-loop.cc
@@ -2453,8 +2453,13 @@ vect_dissolve_slp_only_groups (loop_vec_info loop_vinfo)
                  DR_GROUP_FIRST_ELEMENT (vinfo) = vinfo;
                  DR_GROUP_NEXT_ELEMENT (vinfo) = NULL;
                  DR_GROUP_SIZE (vinfo) = 1;
-                 if (STMT_VINFO_STRIDED_P (first_element))
-                   DR_GROUP_GAP (vinfo) = 0;
+                 if (STMT_VINFO_STRIDED_P (first_element)
+                     /* We cannot handle stores with gaps.  */
+                     || DR_IS_WRITE (dr_info->dr))
+                   {
+                     STMT_VINFO_STRIDED_P (vinfo) = true;
+                     DR_GROUP_GAP (vinfo) = 0;
+                   }
                  else
                    DR_GROUP_GAP (vinfo) = group_size - 1;
                  /* Duplicate and adjust alignment info, it needs to

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

* [Bug tree-optimization/111136] ICE in RISC-V test case since r14-3441-ga1558e9ad85693
  2023-08-24 14:49 [Bug tree-optimization/111136] New: ICE in RISC-V test case since r14-3441-ga1558e9ad85693 rdapp at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2023-08-25  7:42 ` rguenth at gcc dot gnu.org
@ 2023-08-25  7:51 ` rdapp at gcc dot gnu.org
  2023-08-25  8:12 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rdapp at gcc dot gnu.org @ 2023-08-25  7:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Robin Dapp <rdapp at gcc dot gnu.org> ---
All gather-scatter tests pass for me again (the given example in particular)
after applying this.

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

* [Bug tree-optimization/111136] ICE in RISC-V test case since r14-3441-ga1558e9ad85693
  2023-08-24 14:49 [Bug tree-optimization/111136] New: ICE in RISC-V test case since r14-3441-ga1558e9ad85693 rdapp at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2023-08-25  7:51 ` rdapp at gcc dot gnu.org
@ 2023-08-25  8:12 ` rguenth at gcc dot gnu.org
  2023-08-25  8:18 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-08-25  8:12 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manuel.lauss at googlemail dot com

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
*** Bug 111142 has been marked as a duplicate of this bug. ***

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

* [Bug tree-optimization/111136] ICE in RISC-V test case since r14-3441-ga1558e9ad85693
  2023-08-24 14:49 [Bug tree-optimization/111136] New: ICE in RISC-V test case since r14-3441-ga1558e9ad85693 rdapp at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2023-08-25  8:12 ` rguenth at gcc dot gnu.org
@ 2023-08-25  8:18 ` cvs-commit at gcc dot gnu.org
  2023-08-25  8:18 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-08-25  8:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from CVS 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:a739bac402ea5a583e43dbd01c14ebaff317c885

commit r14-3477-ga739bac402ea5a583e43dbd01c14ebaff317c885
Author: Richard Biener <rguenther@suse.de>
Date:   Fri Aug 25 09:42:16 2023 +0200

    tree-optimization/111136 - STMT_VINFO_SLP_VECT_ONLY and stores

    vect_dissolve_slp_only_groups currently only expects loads, for stores
    we have to make sure to mark the dissolved "groups" strided.

            PR tree-optimization/111136
            * tree-vect-loop.cc (vect_dissolve_slp_only_groups): For
            stores force STMT_VINFO_STRIDED_P and also duplicate that
            to all elements.

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

* [Bug tree-optimization/111136] ICE in RISC-V test case since r14-3441-ga1558e9ad85693
  2023-08-24 14:49 [Bug tree-optimization/111136] New: ICE in RISC-V test case since r14-3441-ga1558e9ad85693 rdapp at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2023-08-25  8:18 ` cvs-commit at gcc dot gnu.org
@ 2023-08-25  8:18 ` rguenth at gcc dot gnu.org
  2023-08-28  7:13 ` rguenth at gcc dot gnu.org
  2024-02-02  3:46 ` [Bug tree-optimization/111136] [14 Regression] " pinskia at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-08-25  8:18 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.

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

* [Bug tree-optimization/111136] ICE in RISC-V test case since r14-3441-ga1558e9ad85693
  2023-08-24 14:49 [Bug tree-optimization/111136] New: ICE in RISC-V test case since r14-3441-ga1558e9ad85693 rdapp at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2023-08-25  8:18 ` rguenth at gcc dot gnu.org
@ 2023-08-28  7:13 ` rguenth at gcc dot gnu.org
  2024-02-02  3:46 ` [Bug tree-optimization/111136] [14 Regression] " pinskia at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-08-28  7:13 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |adhemerval.zanella at linaro dot o
                   |                            |rg

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
*** Bug 111156 has been marked as a duplicate of this bug. ***

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

* [Bug tree-optimization/111136] [14 Regression] ICE in RISC-V test case since r14-3441-ga1558e9ad85693
  2023-08-24 14:49 [Bug tree-optimization/111136] New: ICE in RISC-V test case since r14-3441-ga1558e9ad85693 rdapp at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2023-08-28  7:13 ` rguenth at gcc dot gnu.org
@ 2024-02-02  3:46 ` pinskia at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-02-02  3:46 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
   Target Milestone|---                         |14.0
            Summary|ICE in RISC-V test case     |[14 Regression] ICE in
                   |since                       |RISC-V test case since
                   |r14-3441-ga1558e9ad85693    |r14-3441-ga1558e9ad85693

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

end of thread, other threads:[~2024-02-02  3:46 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-24 14:49 [Bug tree-optimization/111136] New: ICE in RISC-V test case since r14-3441-ga1558e9ad85693 rdapp at gcc dot gnu.org
2023-08-25  3:35 ` [Bug tree-optimization/111136] " juzhe.zhong at rivai dot ai
2023-08-25  7:16 ` rguenth at gcc dot gnu.org
2023-08-25  7:42 ` rguenth at gcc dot gnu.org
2023-08-25  7:51 ` rdapp at gcc dot gnu.org
2023-08-25  8:12 ` rguenth at gcc dot gnu.org
2023-08-25  8:18 ` cvs-commit at gcc dot gnu.org
2023-08-25  8:18 ` rguenth at gcc dot gnu.org
2023-08-28  7:13 ` rguenth at gcc dot gnu.org
2024-02-02  3:46 ` [Bug tree-optimization/111136] [14 Regression] " pinskia 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).