On Mon, Dec 03, 2018 at 09:55:36AM +0000, Ramana Radhakrishnan wrote:
> 2018-11-23  Ramana Radhakrishnan  <ramana.radhakrish...@arm.com>
> 
>          * config/aarch64/aarch64-opts.h (enum stack_protector_guard): New
>          * config/aarch64/aarch64.c (aarch64_override_options_internal): 
> Handle
>          and put in error checks for stack protector guard options.
>          (aarch64_stack_protect_guard): New.
>          (TARGET_STACK_PROTECT_GUARD): Define.
>          * config/aarch64/aarch64.md (UNSPEC_SSP_SYSREG): New.
>          (reg_stack_protect_address<mode>): New.
>          (stack_protect_set): Adjust for SSP_GLOBAL.
>          (stack_protect_test): Likewise.
>          * config/aarch64/aarch64.opt (-mstack-protector-guard-reg): New.
>          (-mstack-protector-guard): Likewise.
>          (-mstack-protector-guard-offset): Likewise.
>          * doc/invoke.texi: Document new AArch64 options.

> @@ -17872,8 +17907,24 @@ aarch64_run_selftests (void)
>  
>  } // namespace selftest
>  
> +/* Implement TARGET_STACK_PROTECT_GUARD. In case of a
> +   global variable based guard use the default else
> +   return a null tree.  */
> +static tree
> +aarch64_stack_protect_guard (void)
> +{
> +  if (aarch64_stack_protector_guard == SSP_GLOBAL)
> +    return default_stack_protect_guard ();
> +
> +  return NULL_TREE;
> +}
> +
> +
>  #endif /* #if CHECKING_P */
>  
> +#undef TARGET_STACK_PROTECT_GUARD
> +#define TARGET_STACK_PROTECT_GUARD aarch64_stack_protect_guard
> +

The above change broke aarch64 --enable-checking=release bootstrap.
I've committed as obvious following change to unbreak it:

2019-01-19  Jakub Jelinek  <ja...@redhat.com>

        * config/aarch64/aarch64.c (aarch64_stack_protect_guard): Move
        outside of #if CHECKING_P code.

--- gcc/config/aarch64/aarch64.c.jj     2019-01-19 09:39:18.859831024 +0100
+++ gcc/config/aarch64/aarch64.c        2019-01-19 18:25:18.037239167 +0100
@@ -18662,6 +18662,19 @@ aarch64_simd_clone_usable (struct cgraph
     }
 }
 
+/* Implement TARGET_STACK_PROTECT_GUARD. In case of a
+   global variable based guard use the default else
+   return a null tree.  */
+static tree
+aarch64_stack_protect_guard (void)
+{
+  if (aarch64_stack_protector_guard == SSP_GLOBAL)
+    return default_stack_protect_guard ();
+
+  return NULL_TREE;
+}
+
+
 /* Target-specific selftests.  */
 
 #if CHECKING_P
@@ -18706,19 +18719,6 @@ aarch64_run_selftests (void)
 
 } // namespace selftest
 
-/* Implement TARGET_STACK_PROTECT_GUARD. In case of a
-   global variable based guard use the default else
-   return a null tree.  */
-static tree
-aarch64_stack_protect_guard (void)
-{
-  if (aarch64_stack_protector_guard == SSP_GLOBAL)
-    return default_stack_protect_guard ();
-
-  return NULL_TREE;
-}
-
-
 #endif /* #if CHECKING_P */
 
 #undef TARGET_STACK_PROTECT_GUARD


        Jakub

Reply via email to