public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/113270] New: [14 Regression] AArch64 ICEs in register_tuple_type
@ 2024-01-08 11:36 jakub at gcc dot gnu.org
  2024-01-08 11:36 ` [Bug target/113270] " jakub at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-01-08 11:36 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 113270
           Summary: [14 Regression] AArch64 ICEs in register_tuple_type
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

Several packages in Fedora ICE with PCH.
A simple reproducer is e.g.
cat ppp.h
extern int i;
cat ppp.C
#include <arm_neon.h>
./cc1plus.r14-6751 -quiet -v -iprefix
/usr/src/gcc/objaa/gcc/../lib/gcc/aarch64-linux/14.0.0/ -isystem ./include
-isystem ./include-fixed -D_GNU_SOURCE ppp.h -quiet -dumpbase ppp.h.h
-dumpbase-ext .h -mlittle-endian -mabi=lp64 -Winvalid-pch -version -o
/tmp/ccGpU4JW.s --output-pch ppp.h.gch
./cc1plus.r14-6751 -quiet -v -iprefix
/usr/src/gcc/objaa/gcc/../lib/gcc/aarch64-linux/14.0.0/ -isystem ./include
-isystem ./include-fixed -D_GNU_SOURCE -isystem include/ -include ppp.h
-isystem /usr/include ppp.C -quiet -dumpdir a- -dumpbase ppp.C -dumpbase-ext .C
-mlittle-endian -mabi=lp64 -Winvalid-pch -version -o /tmp/ccwJQz4y.s
GNU C++17 (GCC) version 14.0.0 20231220 (experimental) (aarch64-linux-gnu)
        compiled by GNU C version 12.1.1 20220507 (Red Hat 12.1.1-1), GMP
version 6.2.1, MPFR version 4.1.0-p13, MPC version 1.2.1, isl version
isl-0.16.1-GMP

GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
ignoring duplicate directory "include/"
ignoring nonexistent directory
"/usr/src/gcc/objaa/gcc/../lib/gcc/aarch64-linux/14.0.0/../../../../aarch64-linux-gnu/include/c++/14.0.0"
ignoring nonexistent directory
"/usr/src/gcc/objaa/gcc/../lib/gcc/aarch64-linux/14.0.0/../../../../aarch64-linux-gnu/include/c++/14.0.0/aarch64-linux-gnu"
ignoring nonexistent directory
"/usr/src/gcc/objaa/gcc/../lib/gcc/aarch64-linux/14.0.0/../../../../aarch64-linux-gnu/include/c++/14.0.0/backward"
ignoring nonexistent directory
"/usr/src/gcc/objaa/gcc/../lib/gcc/aarch64-linux/14.0.0/include"
ignoring nonexistent directory
"/usr/src/gcc/objaa/gcc/../lib/gcc/aarch64-linux/14.0.0/include-fixed"
ignoring nonexistent directory
"/usr/src/gcc/objaa/gcc/../lib/gcc/aarch64-linux/14.0.0/../../../../aarch64-linux-gnu/sys-include"
ignoring nonexistent directory
"/usr/src/gcc/objaa/gcc/../lib/gcc/aarch64-linux/14.0.0/../../../../aarch64-linux-gnu/include"
ignoring nonexistent directory
"/usr/local/lib/../aarch64-linux-gnu/include/c++/14.0.0"
ignoring nonexistent directory
"/usr/local/lib/../aarch64-linux-gnu/include/c++/14.0.0/aarch64-linux-gnu"
ignoring nonexistent directory
"/usr/local/lib/../aarch64-linux-gnu/include/c++/14.0.0/backward"
ignoring nonexistent directory
"/usr/local/lib/gcc/aarch64-linux-gnu/14.0.0/include"
ignoring nonexistent directory
"/usr/local/lib/gcc/aarch64-linux-gnu/14.0.0/include-fixed"
ignoring nonexistent directory
"/usr/local/lib/../aarch64-linux-gnu/sys-include"
ignoring nonexistent directory "/usr/local/lib/../aarch64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 ./include
 ./include-fixed
 /usr/include
End of search list.
Compiler executable checksum: 99072b28e2767f6b7a4ea027ec31d235
In file included from ppp.C:1:
./include/arm_neon.h:33:21: internal compiler error: Segmentation fault
   33 | #pragma GCC aarch64 "arm_neon.h"
      |                     ^~~~~~~~~~~~
0x1b247a2 crash_signal
        ../../gcc/toplev.cc:316
0x1efe6bd tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
        ../../gcc/tree.cc:9004
0xddec4b tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
        ../../gcc/tree.h:3767
0x1ef7e72 build_array_type_1(tree_node*, tree_node*, bool, bool, bool)
        ../../gcc/tree.cc:7344
0x1ef815d build_array_type(tree_node*, tree_node*, bool)
        ../../gcc/tree.cc:7378
0x1ef821d build_array_type_nelts(tree_node*, poly_int<2u, unsigned long>)
        ../../gcc/tree.cc:7395
0x21753d3 register_tuple_type
        ../../gcc/config/aarch64/aarch64-builtins.cc:1482
0x21759a8 handle_arm_neon_h()
        ../../gcc/config/aarch64/aarch64-builtins.cc:1555
0x1352ab5 aarch64_pragma_aarch64
        ../../gcc/config/aarch64/aarch64-c.cc:351
0x13102d5 c_invoke_pragma_handler(unsigned int)
        ../../gcc/c-family/c-pragma.cc:1741
0x10fb1d7 cp_parser_pragma
        ../../gcc/cp/parser.cc:50704
0x109cc21 cp_parser_toplevel_declaration
        ../../gcc/cp/parser.cc:15392
0x1084a34 cp_parser_translation_unit
        ../../gcc/cp/parser.cc:5273
0x10fb45b c_parse_file()
        ../../gcc/cp/parser.cc:50798
0x1309a22 c_common_parse_file()
        ../../gcc/c-family/c-opts.cc:1301
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.

This worked fine in r14-1.
(gdb) p aarch64_simd_types[0]
$1 = {type = Int8x8_t, name = 0x35d3297 "__Int8x8_t", mangle = 0x35d32a2
"10__Int8x8_t", itype = <ggc_freed 0x7fffea29f0a8>, eltype = <ggc_freed
0x7fffea14b2a0>, mode = E_V8QImode, 
  q = qualifier_none}
(gdb) p aarch64_simd_types[1]
$2 = {type = Int8x16_t, name = 0x35d32af "__Int8x16_t", mangle = 0x35d32bb
"11__Int8x16_t", itype = <ggc_freed 0x7fffea29f1f8>, eltype = <ggc_freed
0x7fffea14b2a0>, 
  mode = E_V16QImode, q = qualifier_none}
(gdb) p aarch64_simd_types[2]
$3 = {type = Int16x4_t, name = 0x35d32c9 "__Int16x4_t", mangle = 0x35d32d5
"11__Int16x4_t", itype = <ggc_freed 0x7fffea29f348>, eltype = <ggc_freed
0x7fffea14b498>, 
  mode = E_V4HImode, q = qualifier_none}
etc.

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

* [Bug target/113270] [14 Regression] AArch64 ICEs in register_tuple_type
  2024-01-08 11:36 [Bug target/113270] New: [14 Regression] AArch64 ICEs in register_tuple_type jakub at gcc dot gnu.org
@ 2024-01-08 11:36 ` jakub at gcc dot gnu.org
  2024-01-08 12:02 ` [Bug target/113270] [14 Regression] AArch64 ICEs in register_tuple_type since r14-6524 jakub at gcc dot gnu.org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-01-08 11:36 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rsandifo at gcc dot gnu.org
   Target Milestone|---                         |14.0
           Priority|P3                          |P1

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

* [Bug target/113270] [14 Regression] AArch64 ICEs in register_tuple_type since r14-6524
  2024-01-08 11:36 [Bug target/113270] New: [14 Regression] AArch64 ICEs in register_tuple_type jakub at gcc dot gnu.org
  2024-01-08 11:36 ` [Bug target/113270] " jakub at gcc dot gnu.org
@ 2024-01-08 12:02 ` jakub at gcc dot gnu.org
  2024-01-08 12:22 ` jakub at gcc dot gnu.org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-01-08 12:02 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2024-01-08
             Status|UNCONFIRMED                 |NEW
            Summary|[14 Regression] AArch64     |[14 Regression] AArch64
                   |ICEs in register_tuple_type |ICEs in register_tuple_type
                   |                            |since r14-6524
     Ever confirmed|0                           |1

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r14-6524-gc535360788e142a92e1d8b1db25bf4452e26f5fb

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

* [Bug target/113270] [14 Regression] AArch64 ICEs in register_tuple_type since r14-6524
  2024-01-08 11:36 [Bug target/113270] New: [14 Regression] AArch64 ICEs in register_tuple_type jakub at gcc dot gnu.org
  2024-01-08 11:36 ` [Bug target/113270] " jakub at gcc dot gnu.org
  2024-01-08 12:02 ` [Bug target/113270] [14 Regression] AArch64 ICEs in register_tuple_type since r14-6524 jakub at gcc dot gnu.org
@ 2024-01-08 12:22 ` jakub at gcc dot gnu.org
  2024-01-08 12:49 ` jakub at gcc dot gnu.org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-01-08 12:22 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ktkachov at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I don't really know why, not sure if GTY types simply must not appear in target
headers other than the main one or one needs to mark such headers somehow such
that gengtype is aware of those, but the generated gt-aarch64-builtins.h after
the change loses:
@@ -58,34 +58,6 @@ EXPORTED_CONST struct ggc_root_tab gt_gg
     &gt_pch_nx_tree_node
   },
   {
-    &aarch64_simd_types[0].name,
-    1 * ARRAY_SIZE (aarch64_simd_types),
-    sizeof (aarch64_simd_types[0]),
-    (gt_pointer_walker) &gt_ggc_m_S,
-    (gt_pointer_walker) &gt_pch_n_S
-  },
-  {
-    &aarch64_simd_types[0].mangle,
-    1 * ARRAY_SIZE (aarch64_simd_types),
-    sizeof (aarch64_simd_types[0]),
-    (gt_pointer_walker) &gt_ggc_m_S,
-    (gt_pointer_walker) &gt_pch_n_S
-  },
-  {
-    &aarch64_simd_types[0].itype,
-    1 * ARRAY_SIZE (aarch64_simd_types),
-    sizeof (aarch64_simd_types[0]),
-    &gt_ggc_mx_tree_node,
-    &gt_pch_nx_tree_node
-  },
-  {
-    &aarch64_simd_types[0].eltype,
-    1 * ARRAY_SIZE (aarch64_simd_types),
-    sizeof (aarch64_simd_types[0]),
-    &gt_ggc_mx_tree_node,
-    &gt_pch_nx_tree_node
-  },
-  {
     &aarch64_builtin_decls[0],
     1 * (AARCH64_BUILTIN_MAX),
     sizeof (aarch64_builtin_decls[0]),
@@ -95,8 +67,3 @@ EXPORTED_CONST struct ggc_root_tab gt_gg
   LAST_GGC_ROOT_TAB
 };

-EXPORTED_CONST struct ggc_root_tab gt_pch_rs_gt_aarch64_builtins_h[] = {
-  { &aarch64_simd_types, 1, sizeof (aarch64_simd_types), NULL, NULL },
-  LAST_GGC_ROOT_TAB
-};
-
where the former is I believe what breaks the PCH.

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

* [Bug target/113270] [14 Regression] AArch64 ICEs in register_tuple_type since r14-6524
  2024-01-08 11:36 [Bug target/113270] New: [14 Regression] AArch64 ICEs in register_tuple_type jakub at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2024-01-08 12:22 ` jakub at gcc dot gnu.org
@ 2024-01-08 12:49 ` jakub at gcc dot gnu.org
  2024-01-08 13:38 ` jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-01-08 12:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
--- gcc/config.gcc.jj   2024-01-03 11:51:24.640826829 +0100
+++ gcc/config.gcc      2024-01-08 13:40:08.583405822 +0100
@@ -350,7 +350,7 @@ aarch64*-*-*)
        cxx_target_objs="aarch64-c.o"
        d_target_objs="aarch64-d.o"
        extra_objs="aarch64-builtins.o aarch-common.o aarch64-sve-builtins.o
aarch64-sve-builtins-shapes.o aarch64-sve-builtins-base.o
aarch64-sve-builtins-sve2.o aarch64-sve-builtins-sme.o
cortex-a57-fma-steering.o aarch64-speculation.o
falkor-tag-collision-avoidance.o aarch-bti-insert.o aarch64-cc-fusion.o
aarch64-early-ra.o aarch64-ldp-fusion.o"
-       target_gtfiles="\$(srcdir)/config/aarch64/aarch64-builtins.cc
\$(srcdir)/config/aarch64/aarch64-sve-builtins.h
\$(srcdir)/config/aarch64/aarch64-sve-builtins.cc"
+       target_gtfiles="\$(srcdir)/config/aarch64/aarch64-builtins.h
\$(srcdir)/config/aarch64/aarch64-builtins.cc
\$(srcdir)/config/aarch64/aarch64-sve-builtins.h
\$(srcdir)/config/aarch64/aarch64-sve-builtins.cc"
        target_has_targetm_common=yes
        ;;
 alpha*-*-*)
doesn't seem to help unfortunately.

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

* [Bug target/113270] [14 Regression] AArch64 ICEs in register_tuple_type since r14-6524
  2024-01-08 11:36 [Bug target/113270] New: [14 Regression] AArch64 ICEs in register_tuple_type jakub at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2024-01-08 12:49 ` jakub at gcc dot gnu.org
@ 2024-01-08 13:38 ` jakub at gcc dot gnu.org
  2024-01-08 13:47 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-01-08 13:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Of course, another bug is that the declaration of aarch64_simd_types isn't GTY
marked:
--- gcc/config/aarch64/aarch64-builtins.h.jj    2024-01-03 12:01:17.852557952
+0100
+++ gcc/config/aarch64/aarch64-builtins.h       2024-01-08 14:07:00.475944698
+0100
@@ -94,6 +94,6 @@ struct GTY(()) aarch64_simd_type_info
   enum aarch64_type_qualifiers q;
 };

-extern aarch64_simd_type_info aarch64_simd_types[];
+extern GTY(()) aarch64_simd_type_info aarch64_simd_types[];

 #endif
which means it is then ignored on the definition as well.
But with the above 2 patches it fails to build because it then tries to include
aarch64_simd_types references in gtype-desc.cc but doesn't include there that
header.

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

* [Bug target/113270] [14 Regression] AArch64 ICEs in register_tuple_type since r14-6524
  2024-01-08 11:36 [Bug target/113270] New: [14 Regression] AArch64 ICEs in register_tuple_type jakub at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2024-01-08 13:38 ` jakub at gcc dot gnu.org
@ 2024-01-08 13:47 ` jakub at gcc dot gnu.org
  2024-01-08 15:57 ` rsandifo at gcc dot gnu.org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-01-08 13:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 57005
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57005&action=edit
gcc14-pr113270.patch

This seems to work by making the type static to the aarch64-builtins.cc TU
and using an exported function to get at the data.

If anyone has ideas how to make gengtype work for this case, it might be
cleaner than this...

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

* [Bug target/113270] [14 Regression] AArch64 ICEs in register_tuple_type since r14-6524
  2024-01-08 11:36 [Bug target/113270] New: [14 Regression] AArch64 ICEs in register_tuple_type jakub at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2024-01-08 13:47 ` jakub at gcc dot gnu.org
@ 2024-01-08 15:57 ` rsandifo at gcc dot gnu.org
  2024-01-08 16:11 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rsandifo at gcc dot gnu.org @ 2024-01-08 15:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Richard Sandiford <rsandifo at gcc dot gnu.org> ---
I think we want the patch in comment 3, but in addition, I then also needed to
use the following for a similar SVE case:

extern GTY(()) tree scalar_types[NUM_VECTOR_TYPES + 1];
tree scalar_types[NUM_VECTOR_TYPES + 1];

In this case that would mean adding:

extern GTY(()) aarch64_simd_type_info aarch64_simd_types[];

just above the definition in aarch64-builtins.cc.

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

* [Bug target/113270] [14 Regression] AArch64 ICEs in register_tuple_type since r14-6524
  2024-01-08 11:36 [Bug target/113270] New: [14 Regression] AArch64 ICEs in register_tuple_type jakub at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2024-01-08 15:57 ` rsandifo at gcc dot gnu.org
@ 2024-01-08 16:11 ` jakub at gcc dot gnu.org
  2024-01-08 16:22 ` rsandifo at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-01-08 16:11 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #57005|0                           |1
        is obsolete|                            |
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 57008
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57008&action=edit
gcc14-pr113270.patch

You're right, that seems to work too.

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

* [Bug target/113270] [14 Regression] AArch64 ICEs in register_tuple_type since r14-6524
  2024-01-08 11:36 [Bug target/113270] New: [14 Regression] AArch64 ICEs in register_tuple_type jakub at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2024-01-08 16:11 ` jakub at gcc dot gnu.org
@ 2024-01-08 16:22 ` rsandifo at gcc dot gnu.org
  2024-01-09 13:07 ` cvs-commit at gcc dot gnu.org
  2024-01-09 13:38 ` jakub at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: rsandifo at gcc dot gnu.org @ 2024-01-08 16:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Richard Sandiford <rsandifo at gcc dot gnu.org> ---
Thanks for trying it, and sorry for not doing it myself.

The patch LGTM FWIW, so preapproved if it passes testing (which I'm sure it
will :))

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

* [Bug target/113270] [14 Regression] AArch64 ICEs in register_tuple_type since r14-6524
  2024-01-08 11:36 [Bug target/113270] New: [14 Regression] AArch64 ICEs in register_tuple_type jakub at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2024-01-08 16:22 ` rsandifo at gcc dot gnu.org
@ 2024-01-09 13:07 ` cvs-commit at gcc dot gnu.org
  2024-01-09 13:38 ` jakub at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-01-09 13:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:33b1173361b08919ef9011e335072925d38327df

commit r14-7040-g33b1173361b08919ef9011e335072925d38327df
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Jan 9 13:57:23 2024 +0100

    aarch64: Fix up GC of aarch64_simd_types [PR113270]

    The r14-6524 changes created aarch64-builtins.h header and moved
    struct aarch64_simd_type_info definition in there.
    Unfortunately, the new header wasn't added to target_gtfiles, so the
    trees and const char * pointer elements in the aarch64_simd_types
    array aren't marked as GC roots anymore.  That breaks e.g. PCH, when
    the array elements then can refer to ggc_freed memory instead of the
expected
    types, but also any other GC collection could free them and further uses
would
    not work correctly.

    Unfortunately, just adding the new header to target_gtfiles doesn't fix
this,
    because non-static variable definitions marked with GTY(()) aren't
considered
    by gengtype, it looks in those cases for an extern GTY(()) declaration, and
    there was none - the aarch64-builtins.h header contains an extern
declaration
    without GTY(()).  Adding GTY(()) to that extern declaration doesn't work,
because
    then gengtype attempts to emit the aarch64_simd_types GC roots in
gtype-desc.cc
    but the corresponding header isn't included there.

    So, the patch instead adds another extern declaration in
aarch64-builtins.cc
    right before the actual definition, which makes sure the GC roots are
registered
    correctly in gt-aarch64-builtins.h (where we want them).

    2024-01-09  Jakub Jelinek  <jakub@redhat.com>

            PR target/113270
            * config.gcc (aarch64*-*-*): Add aarch64-builtins.h to
target_gtfiles.
            * config/aarch64/aarch64-builtins.cc (aarch64_simd_types): Add
extern
            GTY(()) declaration before the definition, drop GTY(()) drom the
            definition.

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

* [Bug target/113270] [14 Regression] AArch64 ICEs in register_tuple_type since r14-6524
  2024-01-08 11:36 [Bug target/113270] New: [14 Regression] AArch64 ICEs in register_tuple_type jakub at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2024-01-09 13:07 ` cvs-commit at gcc dot gnu.org
@ 2024-01-09 13:38 ` jakub at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-01-09 13:38 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2024-01-09 13:38 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-08 11:36 [Bug target/113270] New: [14 Regression] AArch64 ICEs in register_tuple_type jakub at gcc dot gnu.org
2024-01-08 11:36 ` [Bug target/113270] " jakub at gcc dot gnu.org
2024-01-08 12:02 ` [Bug target/113270] [14 Regression] AArch64 ICEs in register_tuple_type since r14-6524 jakub at gcc dot gnu.org
2024-01-08 12:22 ` jakub at gcc dot gnu.org
2024-01-08 12:49 ` jakub at gcc dot gnu.org
2024-01-08 13:38 ` jakub at gcc dot gnu.org
2024-01-08 13:47 ` jakub at gcc dot gnu.org
2024-01-08 15:57 ` rsandifo at gcc dot gnu.org
2024-01-08 16:11 ` jakub at gcc dot gnu.org
2024-01-08 16:22 ` rsandifo at gcc dot gnu.org
2024-01-09 13:07 ` cvs-commit at gcc dot gnu.org
2024-01-09 13:38 ` jakub 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).