public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/103523] New: [12 Regression] SVE float auto-vect float format expand failure
@ 2021-12-01 20:58 tnfchris at gcc dot gnu.org
  2021-12-01 21:19 ` [Bug target/103523] [11/12 " tnfchris at gcc dot gnu.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: tnfchris at gcc dot gnu.org @ 2021-12-01 20:58 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103523
           Summary: [12 Regression] SVE float auto-vect float format
                    expand failure
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tnfchris at gcc dot gnu.org
  Target Milestone: ---
            Target: aarch64-*

The following testcase

float *a;
b, c;
d() {
  float e;
  for (; c; c--, e += b)
    a[c] = e;
}


ICEs with -march=armv8-a+sve -mtune=neoverse-v1 -Ofast, the ICE requires SVE to
be enabled but also requires the neoverse-v1 tuning model to trigger.

The ICE is

during RTL pass: expand
zbuf.i: In function 'd':
zbuf.i:3:1: internal compiler error: in format_helper, at real.h:233
    3 | d() {
      | ^
0xb20be3 format_helper::format_helper<machine_mode>(machine_mode const&)
        /buildAgent/work/aca863c599d7ab73/gcc/real.h:233
0xb20be3 expand_float(rtx_def*, rtx_def*, int)
        /buildAgent/work/aca863c599d7ab73/gcc/optabs.c:5282
0x902f37 expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifier)
        /buildAgent/work/aca863c599d7ab73/gcc/expr.c:9607
0x7f2c4b expand_gimple_stmt_1
        /buildAgent/work/aca863c599d7ab73/gcc/cfgexpand.c:3967
0x7f2c4b expand_gimple_stmt
        /buildAgent/work/aca863c599d7ab73/gcc/cfgexpand.c:4028
0x7f7903 expand_gimple_basic_block
        /buildAgent/work/aca863c599d7ab73/gcc/cfgexpand.c:6069
0x7f9f97 execute
        /buildAgent/work/aca863c599d7ab73/gcc/cfgexpand.c:6795

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

* [Bug target/103523] [11/12 Regression] SVE float auto-vect float format expand failure
  2021-12-01 20:58 [Bug target/103523] New: [12 Regression] SVE float auto-vect float format expand failure tnfchris at gcc dot gnu.org
@ 2021-12-01 21:19 ` tnfchris at gcc dot gnu.org
  2021-12-02  1:35 ` [Bug tree-optimization/103523] " pinskia at gcc dot gnu.org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tnfchris at gcc dot gnu.org @ 2021-12-01 21:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Tamar Christina <tnfchris at gcc dot gnu.org> ---
An additional ICE seen on a month old tree is

during GIMPLE pass: veclower2
zbuf.i: In function 'd':
zbuf.i:3:1: internal compiler error: in to_constant, at poly-int.h:504
0xbc9494 poly_int_pod<2u, unsigned long>::to_constant() const
        /buildAgent/src/gcc/gcc/poly-int.h:504
0x17c16af nunits_for_known_piecewise_op
        /buildAgent/src/gcc/gcc/tree-vect-generic.c:101
0x17c2377 expand_vector_piecewise
        /buildAgent/src/gcc/gcc/tree-vect-generic.c:315
0x17c75e5 expand_vector_operation
        /buildAgent/src/gcc/gcc/tree-vect-generic.c:1254
0x17cde8e expand_vector_operations_1
        /buildAgent/src/gcc/gcc/tree-vect-generic.c:2331
0x17ce083 expand_vector_operations
        /buildAgent/src/gcc/gcc/tree-vect-generic.c:2365
0x17ce25a execute
        /buildAgent/src/gcc/gcc/tree-vect-generic.c:2451

unsure if this was fixed or just hidden...

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

* [Bug tree-optimization/103523] [11/12 Regression] SVE float auto-vect float format expand failure
  2021-12-01 20:58 [Bug target/103523] New: [12 Regression] SVE float auto-vect float format expand failure tnfchris at gcc dot gnu.org
  2021-12-01 21:19 ` [Bug target/103523] [11/12 " tnfchris at gcc dot gnu.org
@ 2021-12-02  1:35 ` pinskia at gcc dot gnu.org
  2021-12-02  1:48 ` pinskia at gcc dot gnu.org
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-02  1:35 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-12-02
             Status|UNCONFIRMED                 |NEW
          Component|target                      |tree-optimization
     Ever confirmed|0                           |1
   Target Milestone|---                         |11.3

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Tamar Christina from comment #1)
> An additional ICE seen on a month old tree is
> unsure if this was fixed or just hidden...

It is extra checking (that is --enable-checking vs --enable-checking=release):
504       gcc_checking_assert (is_constant ());


#7  0x000000000189d858 in nunits_for_known_piecewise_op (type=0xfffff5bc91b0)
at /home/ubuntu/src/upstream-gcc-aarch64/gcc/gcc/tree-vect-generic.c:101
101       return TYPE_VECTOR_SUBPARTS (type).to_constant ();
(gdb) p type
$1 = (const_tree) 0xfffff5bc91b0
(gdb) p debug_generic_expr(type)
vector([2,2]) float

#10 0x00000000018a97a8 in expand_vector_operations_1 (gsi=0xfffffffff570,
dce_ssa_names=0xfffffffff588) at
/home/ubuntu/src/upstream-gcc-aarch64/gcc/gcc/tree-vect-generic.c:2331
(gdb) p code
$9 = MULT_EXPR
(gdb) p type
$10 = (tree) 0xfffff5bc91b0
(gdb) p debug_generic_expr(type)
vector([2,2]) float //E_VNx2SFmode
(gdb) p op
$12 = smul_optab
(gdb) p debug_generic_expr(compute_type)
float
(gdb) p debug_generic_expr(get_compute_type(code, op, type))
float

(gdb) p optab_handler(op, E_VNx2SFmode)
$23 = CODE_FOR_nothing
(gdb) p op
$24 = smul_optab


I don't know enough of the SVE backend to understand VNx2SF vs VNx4SF really
and why the vectorizer is chosing VNx2SF mode here which does not support half
of the instructions (according to the backend).

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

* [Bug tree-optimization/103523] [11/12 Regression] SVE float auto-vect float format expand failure
  2021-12-01 20:58 [Bug target/103523] New: [12 Regression] SVE float auto-vect float format expand failure tnfchris at gcc dot gnu.org
  2021-12-01 21:19 ` [Bug target/103523] [11/12 " tnfchris at gcc dot gnu.org
  2021-12-02  1:35 ` [Bug tree-optimization/103523] " pinskia at gcc dot gnu.org
@ 2021-12-02  1:48 ` pinskia at gcc dot gnu.org
  2021-12-02 10:57 ` rguenth at gcc dot gnu.org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-02  1:48 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Reduced testcase:
void d(float *a, float b, int c) {
  float e;
  for (; c; c--, e += b)
    a[c] = e;
}

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

* [Bug tree-optimization/103523] [11/12 Regression] SVE float auto-vect float format expand failure
  2021-12-01 20:58 [Bug target/103523] New: [12 Regression] SVE float auto-vect float format expand failure tnfchris at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2021-12-02  1:48 ` pinskia at gcc dot gnu.org
@ 2021-12-02 10:57 ` rguenth at gcc dot gnu.org
  2021-12-03  8:33 ` joelh at gcc dot gnu.org
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-12-02 10:57 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2

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

* [Bug tree-optimization/103523] [11/12 Regression] SVE float auto-vect float format expand failure
  2021-12-01 20:58 [Bug target/103523] New: [12 Regression] SVE float auto-vect float format expand failure tnfchris at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2021-12-02 10:57 ` rguenth at gcc dot gnu.org
@ 2021-12-03  8:33 ` joelh at gcc dot gnu.org
  2021-12-03  8:37 ` [Bug tree-optimization/103523] [11/12 Regression] SVE float auto-vect float format expand failure exposed by r11-7861-ge4180ab2f pinskia at gcc dot gnu.org
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: joelh at gcc dot gnu.org @ 2021-12-03  8:33 UTC (permalink / raw)
  To: gcc-bugs

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

Joel Hutton <joelh at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

--- Comment #4 from Joel Hutton <joelh at gcc dot gnu.org> ---
introduced 26th March by e4180ab2f

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

* [Bug tree-optimization/103523] [11/12 Regression] SVE float auto-vect float format expand failure exposed by r11-7861-ge4180ab2f
  2021-12-01 20:58 [Bug target/103523] New: [12 Regression] SVE float auto-vect float format expand failure tnfchris at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2021-12-03  8:33 ` joelh at gcc dot gnu.org
@ 2021-12-03  8:37 ` pinskia at gcc dot gnu.org
  2021-12-06 12:10 ` tnfchris at gcc dot gnu.org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-03  8:37 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[11/12 Regression] SVE      |[11/12 Regression] SVE
                   |float auto-vect float       |float auto-vect float
                   |format expand failure       |format expand failure
                   |introduced by               |exposed by
                   |r11-7861-ge4180ab2f         |r11-7861-ge4180ab2f

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Joel Hutton from comment #4)
> introduced 26th March by e4180ab2f

That just exposed it.
Try "-Ofast -march=armv8-a+sve -fno-vect-cost-model" as that fails also.

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

* [Bug tree-optimization/103523] [11/12 Regression] SVE float auto-vect float format expand failure exposed by r11-7861-ge4180ab2f
  2021-12-01 20:58 [Bug target/103523] New: [12 Regression] SVE float auto-vect float format expand failure tnfchris at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2021-12-03  8:37 ` [Bug tree-optimization/103523] [11/12 Regression] SVE float auto-vect float format expand failure exposed by r11-7861-ge4180ab2f pinskia at gcc dot gnu.org
@ 2021-12-06 12:10 ` tnfchris at gcc dot gnu.org
  2021-12-10 10:28 ` [Bug tree-optimization/103523] [11/12 Regression] vectorizable_induction generating code for modes without checking support for them " cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tnfchris at gcc dot gnu.org @ 2021-12-06 12:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Tamar Christina <tnfchris at gcc dot gnu.org> ---
Looks like the ICE is cause by a bug in `vectorizable_induction` not checking
for MULT_EXPR and PLUS_EXPR for the given type before it tries to emit them.

This then leads to veclower trying to lower the operation since it's not
supported and then this ICEs since veclower can only handle fixed-size vectors.

The reason we generate this in the first place is due to the epilogue mask.

The main loop is vectorized using VNx4SF and we generate an epilogue for
VNx2SF.

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

* [Bug tree-optimization/103523] [11/12 Regression] vectorizable_induction generating code for modes without checking support for them by r11-7861-ge4180ab2f
  2021-12-01 20:58 [Bug target/103523] New: [12 Regression] SVE float auto-vect float format expand failure tnfchris at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2021-12-06 12:10 ` tnfchris at gcc dot gnu.org
@ 2021-12-10 10:28 ` cvs-commit at gcc dot gnu.org
  2021-12-10 10:31 ` joelh at gcc dot gnu.org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-12-10 10:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Joel Hutton <joelh@gcc.gnu.org>:

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

commit r12-5889-ga5f65cf7ad640ae398eba7a45c712322ce841809
Author: Joel Hutton <joel.hutton@arm.com>
Date:   Fri Dec 10 10:26:42 2021 +0000

    pr103523: Check for PLUS/MINUS support

    Check for PLUS_EXPR/MINUS_EXPR support in vectorizable_induction.
    PR103523 is an ICE on valid code:

    void d(float *a, float b, int c) {
        float e;
        for (; c; c--, e += b)
          a[c] = e;
    }

    This is due to not checking for PLUS_EXPR support, which is missing in
    VNx2sf mode. This causes an ICE at expand time. This patch adds a check
    for support in vectorizable_induction.

    gcc/ChangeLog:

            PR tree-optimization/103523
            * tree-vect-loop.c (vectorizable_induction): Check for
            PLUS_EXPR/MINUS_EXPR support.

    gcc/testsuite/ChangeLog:

            * gcc.target/aarch64/pr103523.c: New test.

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

* [Bug tree-optimization/103523] [11/12 Regression] vectorizable_induction generating code for modes without checking support for them by r11-7861-ge4180ab2f
  2021-12-01 20:58 [Bug target/103523] New: [12 Regression] SVE float auto-vect float format expand failure tnfchris at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2021-12-10 10:28 ` [Bug tree-optimization/103523] [11/12 Regression] vectorizable_induction generating code for modes without checking support for them " cvs-commit at gcc dot gnu.org
@ 2021-12-10 10:31 ` joelh at gcc dot gnu.org
  2021-12-10 10:47 ` tnfchris at gcc dot gnu.org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: joelh at gcc dot gnu.org @ 2021-12-10 10:31 UTC (permalink / raw)
  To: gcc-bugs

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

Joel Hutton <joelh at gcc dot gnu.org> changed:

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

--- Comment #8 from Joel Hutton <joelh at gcc dot gnu.org> ---
fixed on trunk

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

* [Bug tree-optimization/103523] [11/12 Regression] vectorizable_induction generating code for modes without checking support for them by r11-7861-ge4180ab2f
  2021-12-01 20:58 [Bug target/103523] New: [12 Regression] SVE float auto-vect float format expand failure tnfchris at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2021-12-10 10:31 ` joelh at gcc dot gnu.org
@ 2021-12-10 10:47 ` tnfchris at gcc dot gnu.org
  2021-12-13 14:21 ` [Bug tree-optimization/103523] [11 " cvs-commit at gcc dot gnu.org
  2021-12-15  9:28 ` joelh at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: tnfchris at gcc dot gnu.org @ 2021-12-10 10:47 UTC (permalink / raw)
  To: gcc-bugs

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

Tamar Christina <tnfchris at gcc dot gnu.org> changed:

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

--- Comment #9 from Tamar Christina <tnfchris at gcc dot gnu.org> ---
Ticket is an 11/12 regression, Fixing it on just 12 isn't resolving it :)

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

* [Bug tree-optimization/103523] [11 Regression] vectorizable_induction generating code for modes without checking support for them by r11-7861-ge4180ab2f
  2021-12-01 20:58 [Bug target/103523] New: [12 Regression] SVE float auto-vect float format expand failure tnfchris at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2021-12-10 10:47 ` tnfchris at gcc dot gnu.org
@ 2021-12-13 14:21 ` cvs-commit at gcc dot gnu.org
  2021-12-15  9:28 ` joelh at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-12-13 14:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Joel Hutton <joelh@gcc.gnu.org>:

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

commit r11-9380-gf2cc8d059df8aea1b811a4a68512d137f4e83bd5
Author: Joel Hutton <joel.hutton@arm.com>
Date:   Fri Dec 10 10:26:42 2021 +0000

    pr103523: Check for PLUS/MINUS support

    Check for PLUS_EXPR/MINUS_EXPR support in vectorizable_induction.
    PR103523 is an ICE on valid code:

    void d(float *a, float b, int c) {
        float e;
        for (; c; c--, e += b)
          a[c] = e;
    }

    This is due to not checking for PLUS_EXPR support, which is missing in
    VNx2sf mode. This causes an ICE at expand time. This patch adds a check
    for support in vectorizable_induction.

    gcc/ChangeLog:

            PR tree-optimization/103523
            * tree-vect-loop.c (vectorizable_induction): Check for
            PLUS_EXPR/MINUS_EXPR support.

    gcc/testsuite/ChangeLog:

            * gcc.target/aarch64/pr103523.c: New test.

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

* [Bug tree-optimization/103523] [11 Regression] vectorizable_induction generating code for modes without checking support for them by r11-7861-ge4180ab2f
  2021-12-01 20:58 [Bug target/103523] New: [12 Regression] SVE float auto-vect float format expand failure tnfchris at gcc dot gnu.org
                   ` (10 preceding siblings ...)
  2021-12-13 14:21 ` [Bug tree-optimization/103523] [11 " cvs-commit at gcc dot gnu.org
@ 2021-12-15  9:28 ` joelh at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: joelh at gcc dot gnu.org @ 2021-12-15  9:28 UTC (permalink / raw)
  To: gcc-bugs

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

Joel Hutton <joelh at gcc dot gnu.org> changed:

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

--- Comment #11 from Joel Hutton <joelh at gcc dot gnu.org> ---
Fixed on 11 and trunk.

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

end of thread, other threads:[~2021-12-15  9:28 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-01 20:58 [Bug target/103523] New: [12 Regression] SVE float auto-vect float format expand failure tnfchris at gcc dot gnu.org
2021-12-01 21:19 ` [Bug target/103523] [11/12 " tnfchris at gcc dot gnu.org
2021-12-02  1:35 ` [Bug tree-optimization/103523] " pinskia at gcc dot gnu.org
2021-12-02  1:48 ` pinskia at gcc dot gnu.org
2021-12-02 10:57 ` rguenth at gcc dot gnu.org
2021-12-03  8:33 ` joelh at gcc dot gnu.org
2021-12-03  8:37 ` [Bug tree-optimization/103523] [11/12 Regression] SVE float auto-vect float format expand failure exposed by r11-7861-ge4180ab2f pinskia at gcc dot gnu.org
2021-12-06 12:10 ` tnfchris at gcc dot gnu.org
2021-12-10 10:28 ` [Bug tree-optimization/103523] [11/12 Regression] vectorizable_induction generating code for modes without checking support for them " cvs-commit at gcc dot gnu.org
2021-12-10 10:31 ` joelh at gcc dot gnu.org
2021-12-10 10:47 ` tnfchris at gcc dot gnu.org
2021-12-13 14:21 ` [Bug tree-optimization/103523] [11 " cvs-commit at gcc dot gnu.org
2021-12-15  9:28 ` joelh 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).