public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/104474] New: [12 Regression] ICE: in output_constant_pool_2, at varasm.cc:4062 with -mcpu=neoverse-512tvb -frounding-math -msve-vector-bits=512
@ 2022-02-09 19:27 zsojka at seznam dot cz
  2022-02-09 19:32 ` [Bug target/104474] " pinskia at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: zsojka at seznam dot cz @ 2022-02-09 19:27 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 104474
           Summary: [12 Regression] ICE: in output_constant_pool_2, at
                    varasm.cc:4062 with -mcpu=neoverse-512tvb
                    -frounding-math -msve-vector-bits=512
           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: zsojka at seznam dot cz
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu
            Target: aarch64-unknown-linux-gnu

Created attachment 52398
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52398&action=edit
reduced testcase

Compiler output:
$ aarch64-unknown-linux-gnu-gcc -mcpu=neoverse-512tvb -frounding-math
-msve-vector-bits=512 testcase.c 
testcase.c:7:1: internal compiler error: in output_constant_pool_2, at
varasm.cc:4062
    7 | }
      | ^
0x847ae5 output_constant_pool_2
        /repo/gcc-trunk/gcc/varasm.cc:4062
0x147dc85 output_constant_pool_2
        /repo/gcc-trunk/gcc/varasm.cc:4120
0x147deec output_constant_pool_1
        /repo/gcc-trunk/gcc/varasm.cc:4188
0x1489dec output_constant_pool_contents
        /repo/gcc-trunk/gcc/varasm.cc:4345
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.

$ aarch64-unknown-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-aarch64/bin/aarch64-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r12-7143-20220209111047-ged3fea09b18-checking-yes-rtl-df-extra-aarch64/bin/../libexec/gcc/aarch64-unknown-linux-gnu/12.0.1/lto-wrapper
Target: aarch64-unknown-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl
--with-sysroot=/usr/aarch64-unknown-linux-gnu --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=aarch64-unknown-linux-gnu
--with-ld=/usr/bin/aarch64-unknown-linux-gnu-ld
--with-as=/usr/bin/aarch64-unknown-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r12-7143-20220209111047-ged3fea09b18-checking-yes-rtl-df-extra-aarch64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.1 20220209 (experimental) (GCC)

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

* [Bug target/104474] [12 Regression] ICE: in output_constant_pool_2, at varasm.cc:4062 with -mcpu=neoverse-512tvb -frounding-math -msve-vector-bits=512
  2022-02-09 19:27 [Bug target/104474] New: [12 Regression] ICE: in output_constant_pool_2, at varasm.cc:4062 with -mcpu=neoverse-512tvb -frounding-math -msve-vector-bits=512 zsojka at seznam dot cz
@ 2022-02-09 19:32 ` pinskia at gcc dot gnu.org
  2022-02-09 19:45 ` [Bug target/104474] [12 Regression] ICE: in output_constant_pool_2, at varasm.cc:4062 with -mcpu=neoverse-512tvb -msve-vector-bits=512 pinskia at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-02-09 19:32 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |12.0

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

* [Bug target/104474] [12 Regression] ICE: in output_constant_pool_2, at varasm.cc:4062 with -mcpu=neoverse-512tvb  -msve-vector-bits=512
  2022-02-09 19:27 [Bug target/104474] New: [12 Regression] ICE: in output_constant_pool_2, at varasm.cc:4062 with -mcpu=neoverse-512tvb -frounding-math -msve-vector-bits=512 zsojka at seznam dot cz
  2022-02-09 19:32 ` [Bug target/104474] " pinskia at gcc dot gnu.org
@ 2022-02-09 19:45 ` pinskia at gcc dot gnu.org
  2022-02-09 19:54 ` pinskia at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-02-09 19:45 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
            Summary|[12 Regression] ICE: in     |[12 Regression] ICE: in
                   |output_constant_pool_2, at  |output_constant_pool_2, at
                   |varasm.cc:4062 with         |varasm.cc:4062 with
                   |-mcpu=neoverse-512tvb       |-mcpu=neoverse-512tvb
                   |-frounding-math             |-msve-vector-bits=512
                   |-msve-vector-bits=512       |
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2022-02-09

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed, the problem is the backend replaces the non-constant parts with
(const_int 0) rather than zero in the mode.
You can also reproduce the failure with just -mcpu=neoverse-512tvb
-msve-vector-bits=512 and:
typedef float __attribute__((__vector_size__ (64))) F;

F
foo (float t)
{
  return (F){t, 0, 0, 0, 0, 0, 0, 5, 0, t};
}

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

* [Bug target/104474] [12 Regression] ICE: in output_constant_pool_2, at varasm.cc:4062 with -mcpu=neoverse-512tvb  -msve-vector-bits=512
  2022-02-09 19:27 [Bug target/104474] New: [12 Regression] ICE: in output_constant_pool_2, at varasm.cc:4062 with -mcpu=neoverse-512tvb -frounding-math -msve-vector-bits=512 zsojka at seznam dot cz
  2022-02-09 19:32 ` [Bug target/104474] " pinskia at gcc dot gnu.org
  2022-02-09 19:45 ` [Bug target/104474] [12 Regression] ICE: in output_constant_pool_2, at varasm.cc:4062 with -mcpu=neoverse-512tvb -msve-vector-bits=512 pinskia at gcc dot gnu.org
@ 2022-02-09 19:54 ` pinskia at gcc dot gnu.org
  2022-02-09 20:00 ` pinskia at gcc dot gnu.org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-02-09 19:54 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This patch should fix it but have not tested it yet:
diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc
index 02ecb2154ea..d9f10301c52 100644
--- a/gcc/config/aarch64/aarch64.cc
+++ b/gcc/config/aarch64/aarch64.cc
@@ -21201,7 +21201,7 @@
aarch64_sve_expand_vector_init_handle_trailing_constants
        {
          rtx x = builder.elt (i + nelts_reqd - n_trailing_constants);
          if (!valid_for_const_vector_p (elem_mode, x))
-           x = const0_rtx;
+           x = CONST0_RTX (elem_mode);
          v.quick_push (x);
        }
       rtx const_vec = v.build ();

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

* [Bug target/104474] [12 Regression] ICE: in output_constant_pool_2, at varasm.cc:4062 with -mcpu=neoverse-512tvb  -msve-vector-bits=512
  2022-02-09 19:27 [Bug target/104474] New: [12 Regression] ICE: in output_constant_pool_2, at varasm.cc:4062 with -mcpu=neoverse-512tvb -frounding-math -msve-vector-bits=512 zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2022-02-09 19:54 ` pinskia at gcc dot gnu.org
@ 2022-02-09 20:00 ` pinskia at gcc dot gnu.org
  2022-02-10  0:49 ` cvs-commit at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-02-09 20:00 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 104478 has been marked as a duplicate of this bug. ***

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

* [Bug target/104474] [12 Regression] ICE: in output_constant_pool_2, at varasm.cc:4062 with -mcpu=neoverse-512tvb  -msve-vector-bits=512
  2022-02-09 19:27 [Bug target/104474] New: [12 Regression] ICE: in output_constant_pool_2, at varasm.cc:4062 with -mcpu=neoverse-512tvb -frounding-math -msve-vector-bits=512 zsojka at seznam dot cz
                   ` (3 preceding siblings ...)
  2022-02-09 20:00 ` pinskia at gcc dot gnu.org
@ 2022-02-10  0:49 ` cvs-commit at gcc dot gnu.org
  2022-02-10  0:53 ` pinskia at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-02-10  0:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Andrew Pinski <pinskia@gcc.gnu.org>:

https://gcc.gnu.org/g:41582f88ec01c5ce2f85ebc4ac2743eb426d6e33

commit r12-7159-g41582f88ec01c5ce2f85ebc4ac2743eb426d6e33
Author: Andrew Pinski <apinski@marvell.com>
Date:   Wed Feb 9 14:56:58 2022 -0800

    [COMMITTED] Fix PR aarch64/104474: ICE with vector float initializers and
non-consts.

    The problem here is that the aarch64 back-end was placing const0_rtx
    into the constant vector RTL even if the mode was a floating point mode.
    The fix is instead to use CONST0_RTX and pass the mode to select the
    correct zero (either const_int or const_double).

    Committed as obvious after a bootstrap/test on aarch64-linux-gnu with
    no regressions.

            PR target/104474

    gcc/ChangeLog:

            * config/aarch64/aarch64.cc
            (aarch64_sve_expand_vector_init_handle_trailing_constants):
            Use CONST0_RTX instead of const0_rtx for the non-constant elements.

    gcc/testsuite/ChangeLog:

            * gcc.target/aarch64/sve/pr104474-1.c: New test.
            * gcc.target/aarch64/sve/pr104474-2.c: New test.
            * gcc.target/aarch64/sve/pr104474-3.c: New test.

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

* [Bug target/104474] [12 Regression] ICE: in output_constant_pool_2, at varasm.cc:4062 with -mcpu=neoverse-512tvb  -msve-vector-bits=512
  2022-02-09 19:27 [Bug target/104474] New: [12 Regression] ICE: in output_constant_pool_2, at varasm.cc:4062 with -mcpu=neoverse-512tvb -frounding-math -msve-vector-bits=512 zsojka at seznam dot cz
                   ` (4 preceding siblings ...)
  2022-02-10  0:49 ` cvs-commit at gcc dot gnu.org
@ 2022-02-10  0:53 ` pinskia at gcc dot gnu.org
  2022-02-10  9:08 ` [Bug target/104474] [10/11 " pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-02-10  0:53 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Fixed.

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

* [Bug target/104474] [10/11 Regression] ICE: in output_constant_pool_2, at varasm.cc:4062 with -mcpu=neoverse-512tvb  -msve-vector-bits=512
  2022-02-09 19:27 [Bug target/104474] New: [12 Regression] ICE: in output_constant_pool_2, at varasm.cc:4062 with -mcpu=neoverse-512tvb -frounding-math -msve-vector-bits=512 zsojka at seznam dot cz
                   ` (5 preceding siblings ...)
  2022-02-10  0:53 ` pinskia at gcc dot gnu.org
@ 2022-02-10  9:08 ` pinskia at gcc dot gnu.org
  2022-04-07  9:53 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-02-10  9:08 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|12.0                        |11.2.1
      Known to work|11.2.1                      |12.0
   Target Milestone|12.0                        |10.4
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=94668
         Resolution|FIXED                       |---
             Status|RESOLVED                    |NEW
           Assignee|pinskia at gcc dot gnu.org         |unassigned at gcc dot gnu.org
            Summary|[12 Regression] ICE: in     |[10/11 Regression] ICE: in
                   |output_constant_pool_2, at  |output_constant_pool_2, at
                   |varasm.cc:4062 with         |varasm.cc:4062 with
                   |-mcpu=neoverse-512tvb       |-mcpu=neoverse-512tvb
                   |-msve-vector-bits=512       |-msve-vector-bits=512

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
So it looks like it is a bug in GCC 10.x and 11.x too and the only reason why
it was not caught back then was the testcase that was added was all 0 for the
constant (gcc.target/aarch64/sve/pr94668.c).

Note -frounding-math testcases are a regression in GCC 12 though due to
r12-4767-g81342e95827f77c.

Note I am not going to do the backport of the patch, someone else can do that.

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

* [Bug target/104474] [10/11 Regression] ICE: in output_constant_pool_2, at varasm.cc:4062 with -mcpu=neoverse-512tvb  -msve-vector-bits=512
  2022-02-09 19:27 [Bug target/104474] New: [12 Regression] ICE: in output_constant_pool_2, at varasm.cc:4062 with -mcpu=neoverse-512tvb -frounding-math -msve-vector-bits=512 zsojka at seznam dot cz
                   ` (6 preceding siblings ...)
  2022-02-10  9:08 ` [Bug target/104474] [10/11 " pinskia at gcc dot gnu.org
@ 2022-04-07  9:53 ` cvs-commit at gcc dot gnu.org
  2022-06-28 10:48 ` [Bug target/104474] [10 " jakub at gcc dot gnu.org
  2023-07-07  9:56 ` rguenth at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-04-07  9:53 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

commit r11-9783-gb8a6fb4b5919140de74fbc6ad6df1a9caba1c9ec
Author: Andrew Pinski <apinski@marvell.com>
Date:   Wed Feb 9 14:56:58 2022 -0800

    [COMMITTED] Fix PR aarch64/104474: ICE with vector float initializers and
non-consts.

    The problem here is that the aarch64 back-end was placing const0_rtx
    into the constant vector RTL even if the mode was a floating point mode.
    The fix is instead to use CONST0_RTX and pass the mode to select the
    correct zero (either const_int or const_double).

    Committed as obvious after a bootstrap/test on aarch64-linux-gnu with
    no regressions.

            PR target/104474

    gcc/ChangeLog:

            * config/aarch64/aarch64.c
            (aarch64_sve_expand_vector_init_handle_trailing_constants):
            Use CONST0_RTX instead of const0_rtx for the non-constant elements.

    gcc/testsuite/ChangeLog:

            * gcc.target/aarch64/sve/pr104474-1.c: New test.
            * gcc.target/aarch64/sve/pr104474-2.c: New test.
            * gcc.target/aarch64/sve/pr104474-3.c: New test.

    (cherry picked from commit 41582f88ec01c5ce2f85ebc4ac2743eb426d6e33)

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

* [Bug target/104474] [10 Regression] ICE: in output_constant_pool_2, at varasm.cc:4062 with -mcpu=neoverse-512tvb  -msve-vector-bits=512
  2022-02-09 19:27 [Bug target/104474] New: [12 Regression] ICE: in output_constant_pool_2, at varasm.cc:4062 with -mcpu=neoverse-512tvb -frounding-math -msve-vector-bits=512 zsojka at seznam dot cz
                   ` (7 preceding siblings ...)
  2022-04-07  9:53 ` cvs-commit at gcc dot gnu.org
@ 2022-06-28 10:48 ` jakub at gcc dot gnu.org
  2023-07-07  9:56 ` rguenth at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-06-28 10:48 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|10.4                        |10.5

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 10.4 is being released, retargeting bugs to GCC 10.5.

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

* [Bug target/104474] [10 Regression] ICE: in output_constant_pool_2, at varasm.cc:4062 with -mcpu=neoverse-512tvb  -msve-vector-bits=512
  2022-02-09 19:27 [Bug target/104474] New: [12 Regression] ICE: in output_constant_pool_2, at varasm.cc:4062 with -mcpu=neoverse-512tvb -frounding-math -msve-vector-bits=512 zsojka at seznam dot cz
                   ` (8 preceding siblings ...)
  2022-06-28 10:48 ` [Bug target/104474] [10 " jakub at gcc dot gnu.org
@ 2023-07-07  9:56 ` rguenth at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-07  9:56 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
   Target Milestone|10.5                        |11.3
         Resolution|---                         |FIXED
      Known to fail|                            |10.5.0

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

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

end of thread, other threads:[~2023-07-07  9:56 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-09 19:27 [Bug target/104474] New: [12 Regression] ICE: in output_constant_pool_2, at varasm.cc:4062 with -mcpu=neoverse-512tvb -frounding-math -msve-vector-bits=512 zsojka at seznam dot cz
2022-02-09 19:32 ` [Bug target/104474] " pinskia at gcc dot gnu.org
2022-02-09 19:45 ` [Bug target/104474] [12 Regression] ICE: in output_constant_pool_2, at varasm.cc:4062 with -mcpu=neoverse-512tvb -msve-vector-bits=512 pinskia at gcc dot gnu.org
2022-02-09 19:54 ` pinskia at gcc dot gnu.org
2022-02-09 20:00 ` pinskia at gcc dot gnu.org
2022-02-10  0:49 ` cvs-commit at gcc dot gnu.org
2022-02-10  0:53 ` pinskia at gcc dot gnu.org
2022-02-10  9:08 ` [Bug target/104474] [10/11 " pinskia at gcc dot gnu.org
2022-04-07  9:53 ` cvs-commit at gcc dot gnu.org
2022-06-28 10:48 ` [Bug target/104474] [10 " jakub at gcc dot gnu.org
2023-07-07  9:56 ` rguenth 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).