Blame SOURCES/gcc8-rh1512529-aarch64.patch

5cc31e
--- gcc/config/aarch64/aarch64.c
5cc31e
+++ gcc/config/aarch64/aarch64.c
5cc31e
@@ -3799,7 +3799,14 @@ aarch64_output_probe_stack_range (rtx reg1, rtx reg2)
5cc31e
   output_asm_insn ("sub\t%0, %0, %1", xops);
5cc31e
 
5cc31e
   /* Probe at TEST_ADDR.  */
5cc31e
-  output_asm_insn ("str\txzr, [%0]", xops);
5cc31e
+  if (flag_stack_clash_protection)
5cc31e
+    {
5cc31e
+      gcc_assert (xops[0] == stack_pointer_rtx);
5cc31e
+      xops[1] = GEN_INT (PROBE_INTERVAL - 8);
5cc31e
+      output_asm_insn ("str\txzr, [%0, %1]", xops);
5cc31e
+    }
5cc31e
+  else
5cc31e
+    output_asm_insn ("str\txzr, [%0]", xops);
5cc31e
 
5cc31e
   /* Test if TEST_ADDR == LAST_ADDR.  */
5cc31e
   xops[1] = reg2;
5cc31e
@@ -4589,6 +4596,133 @@ aarch64_set_handled_components (sbitmap components)
5cc31e
       cfun->machine->reg_is_wrapped_separately[regno] = true;
5cc31e
 }
5cc31e
 
5cc31e
+/* Allocate POLY_SIZE bytes of stack space using TEMP1 and TEMP2 as scratch
5cc31e
+   registers.  */
5cc31e
+
5cc31e
+static void
5cc31e
+aarch64_allocate_and_probe_stack_space (rtx temp1, rtx temp2,
5cc31e
+					poly_int64 poly_size)
5cc31e
+{
5cc31e
+  HOST_WIDE_INT size;
5cc31e
+  if (!poly_size.is_constant (&size))
5cc31e
+    {
5cc31e
+      sorry ("stack probes for SVE frames");
5cc31e
+      return;
5cc31e
+    }
5cc31e
+
5cc31e
+  HOST_WIDE_INT probe_interval
5cc31e
+    = 1 << PARAM_VALUE (PARAM_STACK_CLASH_PROTECTION_PROBE_INTERVAL);
5cc31e
+  HOST_WIDE_INT guard_size
5cc31e
+    = 1 << PARAM_VALUE (PARAM_STACK_CLASH_PROTECTION_GUARD_SIZE);
5cc31e
+  HOST_WIDE_INT guard_used_by_caller = 1024;
5cc31e
+
5cc31e
+  /* SIZE should be large enough to require probing here.  ie, it
5cc31e
+     must be larger than GUARD_SIZE - GUARD_USED_BY_CALLER.
5cc31e
+
5cc31e
+     We can allocate GUARD_SIZE - GUARD_USED_BY_CALLER as a single chunk
5cc31e
+     without any probing.  */
5cc31e
+  gcc_assert (size >= guard_size - guard_used_by_caller);
5cc31e
+  aarch64_sub_sp (temp1, temp2, guard_size - guard_used_by_caller, true);
5cc31e
+  HOST_WIDE_INT orig_size = size;
5cc31e
+  size -= (guard_size - guard_used_by_caller);
5cc31e
+
5cc31e
+  HOST_WIDE_INT rounded_size = size & -probe_interval;
5cc31e
+  HOST_WIDE_INT residual = size - rounded_size;
5cc31e
+
5cc31e
+  /* We can handle a small number of allocations/probes inline.  Otherwise
5cc31e
+     punt to a loop.  */
5cc31e
+  if (rounded_size && rounded_size <= 4 * probe_interval)
5cc31e
+    {
5cc31e
+      /* We don't use aarch64_sub_sp here because we don't want to
5cc31e
+	 repeatedly load TEMP1.  */
5cc31e
+      rtx step = GEN_INT (-probe_interval);
5cc31e
+      if (probe_interval > ARITH_FACTOR)
5cc31e
+	{
5cc31e
+	  emit_move_insn (temp1, step);
5cc31e
+	  step = temp1;
5cc31e
+	}
5cc31e
+
5cc31e
+      for (HOST_WIDE_INT i = 0; i < rounded_size; i += probe_interval)
5cc31e
+	{
5cc31e
+	  rtx_insn *insn = emit_insn (gen_add2_insn (stack_pointer_rtx, step));
5cc31e
+          add_reg_note (insn, REG_STACK_CHECK, const0_rtx);
5cc31e
+
5cc31e
+	  if (probe_interval > ARITH_FACTOR)
5cc31e
+	    {
5cc31e
+	      RTX_FRAME_RELATED_P (insn) = 1;
5cc31e
+	      rtx adj = plus_constant (Pmode, stack_pointer_rtx, -probe_interval);
5cc31e
+	      add_reg_note (insn, REG_CFA_ADJUST_CFA,
5cc31e
+			    gen_rtx_SET (stack_pointer_rtx, adj));
5cc31e
+	    }
5cc31e
+
5cc31e
+	  emit_stack_probe (plus_constant (Pmode, stack_pointer_rtx,
5cc31e
+					   (probe_interval
5cc31e
+					    - GET_MODE_SIZE (word_mode))));
5cc31e
+	  emit_insn (gen_blockage ());
5cc31e
+	}
5cc31e
+      dump_stack_clash_frame_info (PROBE_INLINE, size != rounded_size);
5cc31e
+    }
5cc31e
+  else if (rounded_size)
5cc31e
+    {
5cc31e
+      /* Compute the ending address.  */
5cc31e
+      unsigned int scratchreg = REGNO (temp1);
5cc31e
+      emit_move_insn (temp1, GEN_INT (-rounded_size));
5cc31e
+      rtx_insn *insn
5cc31e
+	 = emit_insn (gen_add3_insn (temp1, stack_pointer_rtx, temp1));
5cc31e
+
5cc31e
+      /* For the initial allocation, we don't have a frame pointer
5cc31e
+	 set up, so we always need CFI notes.  If we're doing the
5cc31e
+	 final allocation, then we may have a frame pointer, in which
5cc31e
+	 case it is the CFA, otherwise we need CFI notes.
5cc31e
+
5cc31e
+	 We can determine which allocation we are doing by looking at
5cc31e
+	 the temporary register.  IP0 is the initial allocation, IP1
5cc31e
+	 is the final allocation.  */
5cc31e
+      if (scratchreg == IP0_REGNUM || !frame_pointer_needed)
5cc31e
+	{
5cc31e
+	  /* We want the CFA independent of the stack pointer for the
5cc31e
+	     duration of the loop.  */
5cc31e
+	  add_reg_note (insn, REG_CFA_DEF_CFA,
5cc31e
+			plus_constant (Pmode, temp1,
5cc31e
+				       (rounded_size + (orig_size - size))));
5cc31e
+	  RTX_FRAME_RELATED_P (insn) = 1;
5cc31e
+	}
5cc31e
+
5cc31e
+      /* This allocates and probes the stack.
5cc31e
+
5cc31e
+	 It also probes at a 4k interval regardless of the value of
5cc31e
+	 PARAM_STACK_CLASH_PROTECTION_PROBE_INTERVAL.  */
5cc31e
+      insn = emit_insn (gen_probe_stack_range (stack_pointer_rtx,
5cc31e
+					       stack_pointer_rtx, temp1));
5cc31e
+
5cc31e
+      /* Now reset the CFA register if needed.  */
5cc31e
+      if (scratchreg == IP0_REGNUM || !frame_pointer_needed)
5cc31e
+	{
5cc31e
+	  add_reg_note (insn, REG_CFA_DEF_CFA,
5cc31e
+			plus_constant (Pmode, stack_pointer_rtx,
5cc31e
+				       (rounded_size + (orig_size - size))));
5cc31e
+	  RTX_FRAME_RELATED_P (insn) = 1;
5cc31e
+	}
5cc31e
+
5cc31e
+      emit_insn (gen_blockage ());
5cc31e
+      dump_stack_clash_frame_info (PROBE_LOOP, size != rounded_size);
5cc31e
+    }
5cc31e
+  else
5cc31e
+    dump_stack_clash_frame_info (PROBE_INLINE, size != rounded_size);
5cc31e
+
5cc31e
+  /* Handle any residuals.
5cc31e
+     Note that any residual must be probed.  */
5cc31e
+  if (residual)
5cc31e
+    {
5cc31e
+      aarch64_sub_sp (temp1, temp2, residual, true);
5cc31e
+      add_reg_note (get_last_insn (), REG_STACK_CHECK, const0_rtx);
5cc31e
+      emit_stack_probe (plus_constant (Pmode, stack_pointer_rtx,
5cc31e
+				       (residual - GET_MODE_SIZE (word_mode))));
5cc31e
+      emit_insn (gen_blockage ());
5cc31e
+    }
5cc31e
+  return;
5cc31e
+}
5cc31e
+
5cc31e
 /* Add a REG_CFA_EXPRESSION note to INSN to say that register REG
5cc31e
    is saved at BASE + OFFSET.  */
5cc31e
 
5cc31e
@@ -4686,7 +4820,54 @@ aarch64_expand_prologue (void)
5cc31e
   rtx ip0_rtx = gen_rtx_REG (Pmode, IP0_REGNUM);
5cc31e
   rtx ip1_rtx = gen_rtx_REG (Pmode, IP1_REGNUM);
5cc31e
 
5cc31e
-  aarch64_sub_sp (ip0_rtx, ip1_rtx, initial_adjust, true);
5cc31e
+  /* We do not fully protect aarch64 against stack clash style attacks
5cc31e
+     as doing so would be prohibitively expensive with less utility over
5cc31e
+     time as newer compilers are deployed.
5cc31e
+
5cc31e
+     We assume the guard is at least 64k.  Furthermore, we assume that
5cc31e
+     the caller has not pushed the stack pointer more than 1k into
5cc31e
+     the guard.  A caller that pushes the stack pointer than 1k into
5cc31e
+     the guard is considered invalid.
5cc31e
+
5cc31e
+     Note that the caller's ability to push the stack pointer into the
5cc31e
+     guard is a function of the number and size of outgoing arguments and/or
5cc31e
+     dynamic stack allocations due to the mandatory save of the link register
5cc31e
+     in the caller's frame.
5cc31e
+
5cc31e
+     With those assumptions the callee can allocate up to 63k of stack
5cc31e
+     space without probing.
5cc31e
+
5cc31e
+     When probing is needed, we emit a probe at the start of the prologue
5cc31e
+     and every PARAM_STACK_CLASH_PROTECTION_PROBE_INTERVAL bytes thereafter.
5cc31e
+
5cc31e
+     We have to track how much space has been allocated, but we do not
5cc31e
+     track stores into the stack as implicit probes except for the
5cc31e
+     fp/lr store.  */
5cc31e
+  HOST_WIDE_INT guard_size
5cc31e
+    = 1 << PARAM_VALUE (PARAM_STACK_CLASH_PROTECTION_GUARD_SIZE);
5cc31e
+  HOST_WIDE_INT guard_used_by_caller = 1024;
5cc31e
+  if (flag_stack_clash_protection)
5cc31e
+    {
5cc31e
+      if (known_eq (frame_size, 0))
5cc31e
+	dump_stack_clash_frame_info (NO_PROBE_NO_FRAME, false);
5cc31e
+      else if (known_lt (initial_adjust, guard_size - guard_used_by_caller)
5cc31e
+	       && known_lt (final_adjust, guard_size - guard_used_by_caller))
5cc31e
+	dump_stack_clash_frame_info (NO_PROBE_SMALL_FRAME, true);
5cc31e
+    }
5cc31e
+
5cc31e
+  /* In theory we should never have both an initial adjustment
5cc31e
+     and a callee save adjustment.  Verify that is the case since the
5cc31e
+     code below does not handle it for -fstack-clash-protection.  */
5cc31e
+  gcc_assert (known_eq (initial_adjust, 0) || callee_adjust == 0);
5cc31e
+
5cc31e
+  /* Only probe if the initial adjustment is larger than the guard
5cc31e
+     less the amount of the guard reserved for use by the caller's
5cc31e
+     outgoing args.  */
5cc31e
+  if (flag_stack_clash_protection
5cc31e
+      && maybe_ge (initial_adjust, guard_size - guard_used_by_caller))
5cc31e
+    aarch64_allocate_and_probe_stack_space (ip0_rtx, ip1_rtx, initial_adjust);
5cc31e
+  else
5cc31e
+    aarch64_sub_sp (ip0_rtx, ip1_rtx, initial_adjust, true);
5cc31e
 
5cc31e
   if (callee_adjust != 0)
5cc31e
     aarch64_push_regs (reg1, reg2, callee_adjust);
5cc31e
@@ -4742,7 +4923,31 @@ aarch64_expand_prologue (void)
5cc31e
 			     callee_adjust != 0 || emit_frame_chain);
5cc31e
   aarch64_save_callee_saves (DFmode, callee_offset, V0_REGNUM, V31_REGNUM,
5cc31e
 			     callee_adjust != 0 || emit_frame_chain);
5cc31e
-  aarch64_sub_sp (ip1_rtx, ip0_rtx, final_adjust, !frame_pointer_needed);
5cc31e
+
5cc31e
+  /* We may need to probe the final adjustment as well.  */
5cc31e
+  if (flag_stack_clash_protection && maybe_ne (final_adjust, 0))
5cc31e
+    {
5cc31e
+      /* First probe if the final adjustment is larger than the guard size
5cc31e
+	 less the amount of the guard reserved for use by the caller's
5cc31e
+	 outgoing args.  */
5cc31e
+      if (maybe_ge (final_adjust, guard_size - guard_used_by_caller))
5cc31e
+	aarch64_allocate_and_probe_stack_space (ip1_rtx, ip0_rtx,
5cc31e
+						final_adjust);
5cc31e
+      else
5cc31e
+	aarch64_sub_sp (ip1_rtx, ip0_rtx, final_adjust, !frame_pointer_needed);
5cc31e
+
5cc31e
+      /* We must also probe if the final adjustment is larger than the guard
5cc31e
+	 that is assumed used by the caller.  This may be sub-optimal.  */
5cc31e
+      if (maybe_ge (final_adjust, guard_used_by_caller))
5cc31e
+	{
5cc31e
+	  if (dump_file)
5cc31e
+	    fprintf (dump_file,
5cc31e
+		     "Stack clash aarch64 large outgoing arg, probing\n");
5cc31e
+	  emit_stack_probe (stack_pointer_rtx);
5cc31e
+	}
5cc31e
+    }
5cc31e
+  else
5cc31e
+    aarch64_sub_sp (ip1_rtx, ip0_rtx, final_adjust, !frame_pointer_needed);
5cc31e
 }
5cc31e
 
5cc31e
 /* Return TRUE if we can use a simple_return insn.
5cc31e
@@ -10476,6 +10681,12 @@ aarch64_override_options_internal (struct gcc_options *opts)
5cc31e
       && opts->x_optimize >= aarch64_tune_params.prefetch->default_opt_level)
5cc31e
     opts->x_flag_prefetch_loop_arrays = 1;
5cc31e
 
5cc31e
+  /* We assume the guard page is 64k.  */
5cc31e
+  maybe_set_param_value (PARAM_STACK_CLASH_PROTECTION_GUARD_SIZE,
5cc31e
+			 16,
5cc31e
+			 opts->x_param_values,
5cc31e
+			 global_options_set.x_param_values);
5cc31e
+
5cc31e
   aarch64_override_options_after_change_1 (opts);
5cc31e
 }
5cc31e
 
5cc31e
@@ -17161,6 +17372,28 @@ aarch64_sched_can_speculate_insn (rtx_insn *insn)
5cc31e
     }
5cc31e
 }
5cc31e
 
5cc31e
+/* It has been decided that to allow up to 1kb of outgoing argument
5cc31e
+   space to be allocated w/o probing.  If more than 1kb of outgoing
5cc31e
+   argment space is allocated, then it must be probed and the last
5cc31e
+   probe must occur no more than 1kbyte away from the end of the
5cc31e
+   allocated space.
5cc31e
+
5cc31e
+   This implies that the residual part of an alloca allocation may
5cc31e
+   need probing in cases where the generic code might not otherwise
5cc31e
+   think a probe is needed.
5cc31e
+
5cc31e
+   This target hook returns TRUE when allocating RESIDUAL bytes of
5cc31e
+   alloca space requires an additional probe, otherwise FALSE is
5cc31e
+   returned.  */
5cc31e
+
5cc31e
+static bool
5cc31e
+aarch64_stack_clash_protection_final_dynamic_probe (rtx residual)
5cc31e
+{
5cc31e
+  return (residual == CONST0_RTX (Pmode)
5cc31e
+	  || GET_CODE (residual) != CONST_INT
5cc31e
+	  || INTVAL (residual) >= 1024);
5cc31e
+}
5cc31e
+
5cc31e
 /* Implement TARGET_COMPUTE_PRESSURE_CLASSES.  */
5cc31e
 
5cc31e
 static int
5cc31e
@@ -17669,6 +17902,10 @@ aarch64_libgcc_floating_mode_supported_p
5cc31e
 #undef TARGET_CONSTANT_ALIGNMENT
5cc31e
 #define TARGET_CONSTANT_ALIGNMENT aarch64_constant_alignment
5cc31e
 
5cc31e
+#undef TARGET_STACK_CLASH_PROTECTION_FINAL_DYNAMIC_PROBE
5cc31e
+#define TARGET_STACK_CLASH_PROTECTION_FINAL_DYNAMIC_PROBE \
5cc31e
+  aarch64_stack_clash_protection_final_dynamic_probe
5cc31e
+
5cc31e
 #undef TARGET_COMPUTE_PRESSURE_CLASSES
5cc31e
 #define TARGET_COMPUTE_PRESSURE_CLASSES aarch64_compute_pressure_classes
5cc31e
 
5cc31e
--- gcc/config/aarch64/aarch64.md
5cc31e
+++ gcc/config/aarch64/aarch64.md
5cc31e
@@ -5812,7 +5812,7 @@
5cc31e
 )
5cc31e
 
5cc31e
 (define_insn "probe_stack_range"
5cc31e
-  [(set (match_operand:DI 0 "register_operand" "=r")
5cc31e
+  [(set (match_operand:DI 0 "register_operand" "=rk")
5cc31e
 	(unspec_volatile:DI [(match_operand:DI 1 "register_operand" "0")
5cc31e
 			     (match_operand:DI 2 "register_operand" "r")]
5cc31e
 			      UNSPECV_PROBE_STACK_RANGE))]
5cc31e
--- gcc/testsuite/gcc.target/aarch64/stack-check-12.c
5cc31e
+++ gcc/testsuite/gcc.target/aarch64/stack-check-12.c
5cc31e
@@ -0,0 +1,20 @@
5cc31e
+/* { dg-do compile } */
5cc31e
+/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=12" } */
5cc31e
+/* { dg-require-effective-target supports_stack_clash_protection } */
5cc31e
+
5cc31e
+extern void arf (unsigned long int *, unsigned long int *);
5cc31e
+void
5cc31e
+frob ()
5cc31e
+{
5cc31e
+  unsigned long int num[1000];
5cc31e
+  unsigned long int den[1000];
5cc31e
+  arf (den, num);
5cc31e
+}
5cc31e
+
5cc31e
+/* This verifies that the scheduler did not break the dependencies
5cc31e
+   by adjusting the offsets within the probe and that the scheduler
5cc31e
+   did not reorder around the stack probes.  */
5cc31e
+/* { dg-final { scan-assembler-times "sub\\tsp, sp, #4096\\n\\tstr\\txzr, .sp, 4088." 3 } } */
5cc31e
+
5cc31e
+
5cc31e
+
5cc31e
--- gcc/testsuite/gcc.target/aarch64/stack-check-13.c
5cc31e
+++ gcc/testsuite/gcc.target/aarch64/stack-check-13.c
5cc31e
@@ -0,0 +1,28 @@
5cc31e
+/* { dg-do compile } */
5cc31e
+/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=12" } */
5cc31e
+/* { dg-require-effective-target supports_stack_clash_protection } */
5cc31e
+
5cc31e
+#define ARG32(X) X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X
5cc31e
+#define ARG192(X) ARG32(X),ARG32(X),ARG32(X),ARG32(X),ARG32(X),ARG32(X)
5cc31e
+void out1(ARG192(__int128));
5cc31e
+int t1(int);
5cc31e
+
5cc31e
+int t3(int x)
5cc31e
+{
5cc31e
+  if (x < 1000)
5cc31e
+    return t1 (x) + 1;
5cc31e
+
5cc31e
+  out1 (ARG192(1));
5cc31e
+  return 0;
5cc31e
+}
5cc31e
+
5cc31e
+
5cc31e
+
5cc31e
+/* This test creates a large (> 1k) outgoing argument area that needs
5cc31e
+   to be probed.  We don't test the exact size of the space or the
5cc31e
+   exact offset to make the test a little less sensitive to trivial
5cc31e
+   output changes.  */
5cc31e
+/* { dg-final { scan-assembler-times "sub\\tsp, sp, #....\\n\\tstr\\txzr, \\\[sp" 1 } } */
5cc31e
+
5cc31e
+
5cc31e
+
5cc31e
--- gcc/testsuite/gcc.target/aarch64/stack-check-14.c
5cc31e
+++ gcc/testsuite/gcc.target/aarch64/stack-check-14.c
5cc31e
@@ -0,0 +1,25 @@
5cc31e
+/* { dg-do compile } */
5cc31e
+/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=12" } */
5cc31e
+/* { dg-require-effective-target supports_stack_clash_protection } */
5cc31e
+
5cc31e
+int t1(int);
5cc31e
+
5cc31e
+int t2(int x)
5cc31e
+{
5cc31e
+  char *p = __builtin_alloca (4050);
5cc31e
+  x = t1 (x);
5cc31e
+  return p[x];
5cc31e
+}
5cc31e
+
5cc31e
+
5cc31e
+/* This test has a constant sized alloca that is smaller than the
5cc31e
+   probe interval.  But it actually requires two probes instead
5cc31e
+   of one because of the optimistic assumptions we made in the
5cc31e
+   aarch64 prologue code WRT probing state. 
5cc31e
+
5cc31e
+   The form can change quite a bit so we just check for two
5cc31e
+   probes without looking at the actual address.  */
5cc31e
+/* { dg-final { scan-assembler-times "str\\txzr," 2 } } */
5cc31e
+
5cc31e
+
5cc31e
+
5cc31e
--- gcc/testsuite/gcc.target/aarch64/stack-check-15.c
5cc31e
+++ gcc/testsuite/gcc.target/aarch64/stack-check-15.c
5cc31e
@@ -0,0 +1,24 @@
5cc31e
+/* { dg-do compile } */
5cc31e
+/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=12" } */
5cc31e
+/* { dg-require-effective-target supports_stack_clash_protection } */
5cc31e
+
5cc31e
+int t1(int);
5cc31e
+
5cc31e
+int t2(int x)
5cc31e
+{
5cc31e
+  char *p = __builtin_alloca (x);
5cc31e
+  x = t1 (x);
5cc31e
+  return p[x];
5cc31e
+}
5cc31e
+
5cc31e
+
5cc31e
+/* This test has a variable sized alloca.  It requires 3 probes.
5cc31e
+   One in the loop, one for the residual and at the end of the
5cc31e
+   alloca area. 
5cc31e
+
5cc31e
+   The form can change quite a bit so we just check for two
5cc31e
+   probes without looking at the actual address.  */
5cc31e
+/* { dg-final { scan-assembler-times "str\\txzr," 3 } } */
5cc31e
+
5cc31e
+
5cc31e
+
5cc31e
--- gcc/testsuite/lib/target-supports.exp
5cc31e
+++ gcc/testsuite/lib/target-supports.exp
5cc31e
@@ -9201,14 +9201,9 @@ proc check_effective_target_autoincdec { } {
5cc31e
 # 
5cc31e
 proc check_effective_target_supports_stack_clash_protection { } {
5cc31e
 
5cc31e
-   # Temporary until the target bits are fully ACK'd.
5cc31e
-#  if { [istarget aarch*-*-*] } {
5cc31e
-#	return 1
5cc31e
-#  }
5cc31e
-
5cc31e
     if { [istarget x86_64-*-*] || [istarget i?86-*-*] 
5cc31e
 	  || [istarget powerpc*-*-*] || [istarget rs6000*-*-*]
5cc31e
-	  || [istarget s390*-*-*] } {
5cc31e
+	  || [istarget aarch64*-**] || [istarget s390*-*-*] } {
5cc31e
 	return 1
5cc31e
     }
5cc31e
   return 0
5cc31e
@@ -9217,9 +9212,9 @@ proc check_effective_target_supports_stack_clash_protection { } {
5cc31e
 # Return 1 if the target creates a frame pointer for non-leaf functions
5cc31e
 # Note we ignore cases where we apply tail call optimization here.
5cc31e
 proc check_effective_target_frame_pointer_for_non_leaf { } {
5cc31e
-  if { [istarget aarch*-*-*] } {
5cc31e
-	return 1
5cc31e
-  }
5cc31e
+#  if { [istarget aarch*-*-*] } {
5cc31e
+#	return 1
5cc31e
+#  }
5cc31e
 
5cc31e
   # Solaris/x86 defaults to -fno-omit-frame-pointer.
5cc31e
   if { [istarget i?86-*-solaris*] || [istarget x86_64-*-solaris*] } {