public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix some GC issues in the aarch64 back-end.
@ 2021-09-03  5:24 apinski
  2021-09-03  9:47 ` Richard Sandiford
  0 siblings, 1 reply; 2+ messages in thread
From: apinski @ 2021-09-03  5:24 UTC (permalink / raw)
  To: gcc-patches; +Cc: Andrew Pinski

From: Andrew Pinski <apinski@marvell.com>

I got some ICEs in my latest testsing while running the libstdc++ testsuite.
I had noticed the problem was connected to types and had just touched the
builtins code but nothing which could have caused this and I looked for
some types/variables that were not being marked with GTY.

OK? Bootstrapped and tested on aarch64-linux-gnu with no regressions.

gcc/ChangeLog:

	* config/aarch64/aarch64-builtins.c (struct aarch64_simd_type_info):
	Mark with GTY.
	(aarch64_simd_types): Likewise.
	(aarch64_simd_intOI_type_node): Likewise.
	(aarch64_simd_intCI_type_node): Likewise.
	(aarch64_simd_intXI_type_node): Likewise.
	* config/aarch64/aarch64.h (aarch64_fp16_type_node): Likewise.
	(aarch64_fp16_ptr_type_node): Likewise.
	(aarch64_bf16_type_node): Likewise.
	(aarch64_bf16_ptr_type_node): Likewise.
---
 gcc/config/aarch64/aarch64-builtins.c | 10 +++++-----
 gcc/config/aarch64/aarch64.h          |  8 ++++----
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/gcc/config/aarch64/aarch64-builtins.c b/gcc/config/aarch64/aarch64-builtins.c
index d441437..9f37a71 100644
--- a/gcc/config/aarch64/aarch64-builtins.c
+++ b/gcc/config/aarch64/aarch64-builtins.c
@@ -594,7 +594,7 @@ enum aarch64_simd_type
 };
 #undef ENTRY
 
-struct aarch64_simd_type_info
+struct GTY(()) aarch64_simd_type_info
 {
   enum aarch64_simd_type type;
 
@@ -626,14 +626,14 @@ struct aarch64_simd_type_info
 
 #define ENTRY(E, M, Q, G)  \
   {E, "__" #E, #G "__" #E, NULL_TREE, NULL_TREE, E_##M##mode, qualifier_##Q},
-static struct aarch64_simd_type_info aarch64_simd_types [] = {
+static GTY(()) struct aarch64_simd_type_info aarch64_simd_types [] = {
 #include "aarch64-simd-builtin-types.def"
 };
 #undef ENTRY
 
-static tree aarch64_simd_intOI_type_node = NULL_TREE;
-static tree aarch64_simd_intCI_type_node = NULL_TREE;
-static tree aarch64_simd_intXI_type_node = NULL_TREE;
+static GTY(()) tree aarch64_simd_intOI_type_node = NULL_TREE;
+static GTY(()) tree aarch64_simd_intCI_type_node = NULL_TREE;
+static GTY(()) tree aarch64_simd_intXI_type_node = NULL_TREE;
 
 /* The user-visible __fp16 type, and a pointer to that type.  Used
    across the back-end.  */
diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h
index bfffbcd..a5ba6c2 100644
--- a/gcc/config/aarch64/aarch64.h
+++ b/gcc/config/aarch64/aarch64.h
@@ -1262,13 +1262,13 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
 
 /* This type is the user-visible __fp16, and a pointer to that type.  We
    need it in many places in the backend.  Defined in aarch64-builtins.c.  */
-extern tree aarch64_fp16_type_node;
-extern tree aarch64_fp16_ptr_type_node;
+extern GTY(()) tree aarch64_fp16_type_node;
+extern GTY(()) tree aarch64_fp16_ptr_type_node;
 
 /* This type is the user-visible __bf16, and a pointer to that type.  Defined
    in aarch64-builtins.c.  */
-extern tree aarch64_bf16_type_node;
-extern tree aarch64_bf16_ptr_type_node;
+extern GTY(()) tree aarch64_bf16_type_node;
+extern GTY(()) tree aarch64_bf16_ptr_type_node;
 
 /* The generic unwind code in libgcc does not initialize the frame pointer.
    So in order to unwind a function using a frame pointer, the very first
-- 
1.8.3.1


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

* Re: [PATCH] Fix some GC issues in the aarch64 back-end.
  2021-09-03  5:24 [PATCH] Fix some GC issues in the aarch64 back-end apinski
@ 2021-09-03  9:47 ` Richard Sandiford
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Sandiford @ 2021-09-03  9:47 UTC (permalink / raw)
  To: apinski--- via Gcc-patches; +Cc: apinski

apinski--- via Gcc-patches <gcc-patches@gcc.gnu.org> writes:
> From: Andrew Pinski <apinski@marvell.com>
>
> I got some ICEs in my latest testsing while running the libstdc++ testsuite.
> I had noticed the problem was connected to types and had just touched the
> builtins code but nothing which could have caused this and I looked for
> some types/variables that were not being marked with GTY.
>
> OK? Bootstrapped and tested on aarch64-linux-gnu with no regressions.

OK.  I'm a bit surprised this makes a difference, since I'd have
expected the builtin function definitions to keep the types live.

I agree the change is clearly correct though.  We shouldn't be relying
on indirect marking.

Thanks,
Richard

>
> gcc/ChangeLog:
>
> 	* config/aarch64/aarch64-builtins.c (struct aarch64_simd_type_info):
> 	Mark with GTY.
> 	(aarch64_simd_types): Likewise.
> 	(aarch64_simd_intOI_type_node): Likewise.
> 	(aarch64_simd_intCI_type_node): Likewise.
> 	(aarch64_simd_intXI_type_node): Likewise.
> 	* config/aarch64/aarch64.h (aarch64_fp16_type_node): Likewise.
> 	(aarch64_fp16_ptr_type_node): Likewise.
> 	(aarch64_bf16_type_node): Likewise.
> 	(aarch64_bf16_ptr_type_node): Likewise.
> ---
>  gcc/config/aarch64/aarch64-builtins.c | 10 +++++-----
>  gcc/config/aarch64/aarch64.h          |  8 ++++----
>  2 files changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/gcc/config/aarch64/aarch64-builtins.c b/gcc/config/aarch64/aarch64-builtins.c
> index d441437..9f37a71 100644
> --- a/gcc/config/aarch64/aarch64-builtins.c
> +++ b/gcc/config/aarch64/aarch64-builtins.c
> @@ -594,7 +594,7 @@ enum aarch64_simd_type
>  };
>  #undef ENTRY
>  
> -struct aarch64_simd_type_info
> +struct GTY(()) aarch64_simd_type_info
>  {
>    enum aarch64_simd_type type;
>  
> @@ -626,14 +626,14 @@ struct aarch64_simd_type_info
>  
>  #define ENTRY(E, M, Q, G)  \
>    {E, "__" #E, #G "__" #E, NULL_TREE, NULL_TREE, E_##M##mode, qualifier_##Q},
> -static struct aarch64_simd_type_info aarch64_simd_types [] = {
> +static GTY(()) struct aarch64_simd_type_info aarch64_simd_types [] = {
>  #include "aarch64-simd-builtin-types.def"
>  };
>  #undef ENTRY
>  
> -static tree aarch64_simd_intOI_type_node = NULL_TREE;
> -static tree aarch64_simd_intCI_type_node = NULL_TREE;
> -static tree aarch64_simd_intXI_type_node = NULL_TREE;
> +static GTY(()) tree aarch64_simd_intOI_type_node = NULL_TREE;
> +static GTY(()) tree aarch64_simd_intCI_type_node = NULL_TREE;
> +static GTY(()) tree aarch64_simd_intXI_type_node = NULL_TREE;
>  
>  /* The user-visible __fp16 type, and a pointer to that type.  Used
>     across the back-end.  */
> diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h
> index bfffbcd..a5ba6c2 100644
> --- a/gcc/config/aarch64/aarch64.h
> +++ b/gcc/config/aarch64/aarch64.h
> @@ -1262,13 +1262,13 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
>  
>  /* This type is the user-visible __fp16, and a pointer to that type.  We
>     need it in many places in the backend.  Defined in aarch64-builtins.c.  */
> -extern tree aarch64_fp16_type_node;
> -extern tree aarch64_fp16_ptr_type_node;
> +extern GTY(()) tree aarch64_fp16_type_node;
> +extern GTY(()) tree aarch64_fp16_ptr_type_node;
>  
>  /* This type is the user-visible __bf16, and a pointer to that type.  Defined
>     in aarch64-builtins.c.  */
> -extern tree aarch64_bf16_type_node;
> -extern tree aarch64_bf16_ptr_type_node;
> +extern GTY(()) tree aarch64_bf16_type_node;
> +extern GTY(()) tree aarch64_bf16_ptr_type_node;
>  
>  /* The generic unwind code in libgcc does not initialize the frame pointer.
>     So in order to unwind a function using a frame pointer, the very first

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

end of thread, other threads:[~2021-09-03  9:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-03  5:24 [PATCH] Fix some GC issues in the aarch64 back-end apinski
2021-09-03  9:47 ` Richard Sandiford

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).