public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/114196] New: [13/14 Regression] Fixed length vector ICE: in vect_peel_nonlinear_iv_init, at tree-vect-loop.cc:9454
@ 2024-03-01 21:35 patrick at rivosinc dot com
  2024-03-02  2:02 ` [Bug middle-end/114196] " pinskia at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: patrick at rivosinc dot com @ 2024-03-01 21:35 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 114196
           Summary: [13/14 Regression] Fixed length vector ICE: in
                    vect_peel_nonlinear_iv_init, at tree-vect-loop.cc:9454
           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: ---

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

Testcase:
unsigned a;
int b;
long *c;
int main() {
  for (short d = 1; d < (short)5443215699099219 - 15932; d += 94 - 90) {
    b = ({
      __typeof__(0) e = c[d];
      e;
    })
            ?: -c[d];
    a *= 3;
  }
}

Backtrace:
> /scratch/tc-testing/tc-feb-20/build-rv64gcv/bin/riscv64-unknown-linux-gnu-gcc -march=rv64gcv_zvl256b -O3 --param=riscv-autovec-preference=fixed-vlmax red.c -o red.out
during GIMPLE pass: vect
./red.c: In function 'main':
./red.c:4:5: internal compiler error: in vect_peel_nonlinear_iv_init, at
tree-vect-loop.cc:9454
    4 | int main() {
      |     ^~~~
0xb04d35 vect_peel_nonlinear_iv_init(gimple**, tree_node*, tree_node*,
tree_node*, vect_induction_op_type)
        ../../../gcc/gcc/tree-vect-loop.cc:9454
0x15e6c54 vect_update_ivs_after_vectorizer
        ../../../gcc/gcc/tree-vect-loop-manip.cc:2368
0x15f3ca7 vect_do_peeling(_loop_vec_info*, tree_node*, tree_node*, tree_node**,
tree_node**, tree_node**, int, bool, bool, tree_node**)
        ../../../gcc/gcc/tree-vect-loop-manip.cc:3501
0x15e198e vect_transform_loop(_loop_vec_info*, gimple*)
        ../../../gcc/gcc/tree-vect-loop.cc:11934
0x1627a01 vect_transform_loops
        ../../../gcc/gcc/tree-vectorizer.cc:1006
0x1628173 try_vectorize_loop_1
        ../../../gcc/gcc/tree-vectorizer.cc:1152
0x1628173 try_vectorize_loop
        ../../../gcc/gcc/tree-vectorizer.cc:1182
0x16287fc 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.

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

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

Found via fuzzer.

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

* [Bug middle-end/114196] [13/14 Regression] Fixed length vector ICE: in vect_peel_nonlinear_iv_init, at tree-vect-loop.cc:9454
  2024-03-01 21:35 [Bug middle-end/114196] New: [13/14 Regression] Fixed length vector ICE: in vect_peel_nonlinear_iv_init, at tree-vect-loop.cc:9454 patrick at rivosinc dot com
@ 2024-03-02  2:02 ` pinskia at gcc dot gnu.org
  2024-03-06 16:09 ` rdapp at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-03-02  2:02 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Target Milestone|---                         |13.3
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2024-03-02
      Known to work|                            |13.1.0
      Known to fail|                            |13.2.0

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
`-O3 -fno-vect-cost-model -march=armv9-a -msve-vector-bits=256` is the aarch64
options.

Confirmed.

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

* [Bug middle-end/114196] [13/14 Regression] Fixed length vector ICE: in vect_peel_nonlinear_iv_init, at tree-vect-loop.cc:9454
  2024-03-01 21:35 [Bug middle-end/114196] New: [13/14 Regression] Fixed length vector ICE: in vect_peel_nonlinear_iv_init, at tree-vect-loop.cc:9454 patrick at rivosinc dot com
  2024-03-02  2:02 ` [Bug middle-end/114196] " pinskia at gcc dot gnu.org
@ 2024-03-06 16:09 ` rdapp at gcc dot gnu.org
  2024-03-07 20:03 ` cvs-commit at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rdapp at gcc dot gnu.org @ 2024-03-06 16:09 UTC (permalink / raw)
  To: gcc-bugs

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

Robin Dapp <rdapp at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=113163

--- Comment #2 from Robin Dapp <rdapp at gcc dot gnu.org> ---
To me this looks like it already came up in the context of early-break
vectorization (PR113163) but is not actually dependent on it.  I'm testing a
patch that disables epilogue peeling also without early break.

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

* [Bug middle-end/114196] [13/14 Regression] Fixed length vector ICE: in vect_peel_nonlinear_iv_init, at tree-vect-loop.cc:9454
  2024-03-01 21:35 [Bug middle-end/114196] New: [13/14 Regression] Fixed length vector ICE: in vect_peel_nonlinear_iv_init, at tree-vect-loop.cc:9454 patrick at rivosinc dot com
  2024-03-02  2:02 ` [Bug middle-end/114196] " pinskia at gcc dot gnu.org
  2024-03-06 16:09 ` rdapp at gcc dot gnu.org
@ 2024-03-07 20:03 ` cvs-commit at gcc dot gnu.org
  2024-03-08 17:43 ` patrick at rivosinc dot com
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-03-07 20:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Robin Dapp <rdapp@gcc.gnu.org>:

https://gcc.gnu.org/g:226043a4d8fb23c7fe7bf16e485b3cfaa094db21

commit r14-9366-g226043a4d8fb23c7fe7bf16e485b3cfaa094db21
Author: Robin Dapp <rdapp@ventanamicro.com>
Date:   Wed Mar 6 16:54:35 2024 +0100

    vect: Do not peel epilogue for partial vectors.

    r14-7036-gcbf569486b2dec added an epilogue vectorization guard for early
    break but PR114196 shows that we also run into the problem without early
    break.  Therefore merge the condition into the topmost vectorization
    guard.

    gcc/ChangeLog:

            PR middle-end/114196

            * tree-vect-loop-manip.cc (vect_can_peel_nonlinear_iv_p): Merge
            vectorization guards.

    gcc/testsuite/ChangeLog:

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

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

* [Bug middle-end/114196] [13/14 Regression] Fixed length vector ICE: in vect_peel_nonlinear_iv_init, at tree-vect-loop.cc:9454
  2024-03-01 21:35 [Bug middle-end/114196] New: [13/14 Regression] Fixed length vector ICE: in vect_peel_nonlinear_iv_init, at tree-vect-loop.cc:9454 patrick at rivosinc dot com
                   ` (2 preceding siblings ...)
  2024-03-07 20:03 ` cvs-commit at gcc dot gnu.org
@ 2024-03-08 17:43 ` patrick at rivosinc dot com
  2024-03-08 17:44 ` patrick at rivosinc dot com
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: patrick at rivosinc dot com @ 2024-03-08 17:43 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

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

* [Bug middle-end/114196] [13/14 Regression] Fixed length vector ICE: in vect_peel_nonlinear_iv_init, at tree-vect-loop.cc:9454
  2024-03-01 21:35 [Bug middle-end/114196] New: [13/14 Regression] Fixed length vector ICE: in vect_peel_nonlinear_iv_init, at tree-vect-loop.cc:9454 patrick at rivosinc dot com
                   ` (3 preceding siblings ...)
  2024-03-08 17:43 ` patrick at rivosinc dot com
@ 2024-03-08 17:44 ` patrick at rivosinc dot com
  2024-03-09  7:34 ` [Bug middle-end/114196] [13 " law at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: patrick at rivosinc dot com @ 2024-03-08 17:44 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #5 from Patrick O'Neill <patrick at rivosinc dot com> ---
Re-opened since this might want to be backported to 13 for aarch64.

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

* [Bug middle-end/114196] [13 Regression] Fixed length vector ICE: in vect_peel_nonlinear_iv_init, at tree-vect-loop.cc:9454
  2024-03-01 21:35 [Bug middle-end/114196] New: [13/14 Regression] Fixed length vector ICE: in vect_peel_nonlinear_iv_init, at tree-vect-loop.cc:9454 patrick at rivosinc dot com
                   ` (4 preceding siblings ...)
  2024-03-08 17:44 ` patrick at rivosinc dot com
@ 2024-03-09  7:34 ` law at gcc dot gnu.org
  2024-05-08 12:25 ` rguenth at gcc dot gnu.org
  2024-05-13  6:23 ` rdapp at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: law at gcc dot gnu.org @ 2024-03-09  7:34 UTC (permalink / raw)
  To: gcc-bugs

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

Jeffrey A. Law <law at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2
            Summary|[13/14 Regression] Fixed    |[13 Regression] Fixed
                   |length vector ICE: in       |length vector ICE: in
                   |vect_peel_nonlinear_iv_init |vect_peel_nonlinear_iv_init
                   |, at tree-vect-loop.cc:9454 |, at tree-vect-loop.cc:9454
                 CC|                            |law at gcc dot gnu.org

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

* [Bug middle-end/114196] [13 Regression] Fixed length vector ICE: in vect_peel_nonlinear_iv_init, at tree-vect-loop.cc:9454
  2024-03-01 21:35 [Bug middle-end/114196] New: [13/14 Regression] Fixed length vector ICE: in vect_peel_nonlinear_iv_init, at tree-vect-loop.cc:9454 patrick at rivosinc dot com
                   ` (5 preceding siblings ...)
  2024-03-09  7:34 ` [Bug middle-end/114196] [13 " law at gcc dot gnu.org
@ 2024-05-08 12:25 ` rguenth at gcc dot gnu.org
  2024-05-13  6:23 ` rdapp at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-05-08 12:25 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |rdapp at gcc dot gnu.org

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
I've recently backported a related change - can you check if the issue is
solved on the 13 branch now?

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

* [Bug middle-end/114196] [13 Regression] Fixed length vector ICE: in vect_peel_nonlinear_iv_init, at tree-vect-loop.cc:9454
  2024-03-01 21:35 [Bug middle-end/114196] New: [13/14 Regression] Fixed length vector ICE: in vect_peel_nonlinear_iv_init, at tree-vect-loop.cc:9454 patrick at rivosinc dot com
                   ` (6 preceding siblings ...)
  2024-05-08 12:25 ` rguenth at gcc dot gnu.org
@ 2024-05-13  6:23 ` rdapp at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: rdapp at gcc dot gnu.org @ 2024-05-13  6:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Robin Dapp <rdapp at gcc dot gnu.org> ---
I can barely build a compiler on gcc185 due to disk space.  I'm going to set up
a cross toolchain (that I need for other purposes as well) in order to test.

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

end of thread, other threads:[~2024-05-13  6:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-01 21:35 [Bug middle-end/114196] New: [13/14 Regression] Fixed length vector ICE: in vect_peel_nonlinear_iv_init, at tree-vect-loop.cc:9454 patrick at rivosinc dot com
2024-03-02  2:02 ` [Bug middle-end/114196] " pinskia at gcc dot gnu.org
2024-03-06 16:09 ` rdapp at gcc dot gnu.org
2024-03-07 20:03 ` cvs-commit at gcc dot gnu.org
2024-03-08 17:43 ` patrick at rivosinc dot com
2024-03-08 17:44 ` patrick at rivosinc dot com
2024-03-09  7:34 ` [Bug middle-end/114196] [13 " law at gcc dot gnu.org
2024-05-08 12:25 ` rguenth at gcc dot gnu.org
2024-05-13  6:23 ` rdapp 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).