Hi All,

This is a minor update to fix stack-check-12.c for ilp32.
The datatype would be too small on ilp32 to require a probe.

gcc/testsuite/
2018-08-28  Tamar Christina  <tamar.christ...@arm.com>

        PR target/86486
        * gcc.dg/pr82788.c: Skip for AArch64.
        * gcc.dg/guality/vla-1.c: Turn off stack-clash.
        * gcc.target/aarch64/subsp.c: Likewise.
        * gcc.dg/params/blocksort-part.c: Skip stack-clash checks
        on AArch64.
        * gcc.dg/stack-check-10.c: Add AArch64 specific checks.
        * gcc.dg/stack-check-12.c: ILP32 fixup.
        * gcc.dg/stack-check-5.c: Add AArch64 specific checks.
        * gcc.dg/stack-check-6a.c: Skip on AArch64, we don't support this.
        * testsuite/lib/target-supports.exp
        (check_effective_target_frame_pointer_for_non_leaf): AArch64 does not
        require frame pointer for non-leaf functions.

As before I assume the OK still applies as the change is trivial so will commit 
this with the rest once all approved.

Thanks,
Tamar

> -----Original Message-----
> From: Jeff Law <l...@redhat.com>
> Sent: Tuesday, August 28, 2018 19:13
> To: Tamar Christina <tamar.christ...@arm.com>; gcc-patches@gcc.gnu.org
> Cc: nd <n...@arm.com>; James Greenhalgh <james.greenha...@arm.com>;
> Richard Earnshaw <richard.earns...@arm.com>; Marcus Shawcroft
> <marcus.shawcr...@arm.com>
> Subject: Re: [PATCH][GCC][AArch64] Cleanup the AArch64 testsuite when
> stack-clash is on [Patch (7/7)]
> 
> On 08/28/2018 06:18 AM, Tamar Christina wrote:
> > Hi All,
> >
> > Since this patch series now contains SVE support I am removing the
> > changes to the SVE tests in this patch series.  I assume the OK still
> > stands as the only change here is undoing updates to three files.
> >
> > Thanks,
> > Tamar
> >
> > gcc/testsuite/
> > 2018-08-28  Tamar Christina  <tamar.christ...@arm.com>
> >
> >     PR target/86486
> >     * gcc.dg/pr82788.c: Skip for AArch64.
> >     * gcc.dg/guality/vla-1.c: Turn off stack-clash.
> >     * gcc.target/aarch64/subsp.c: Likewise.
> >     * gcc.dg/params/blocksort-part.c: Skip stack-clash checks
> >     on AArch64.
> >     * gcc.dg/stack-check-10.c: Add AArch64 specific checks.
> >     * gcc.dg/stack-check-5.c: Add AArch64 specific checks.
> >     * gcc.dg/stack-check-6a.c: Skip on AArch64, we don't support this.
> >     * testsuite/lib/target-supports.exp
> >     (check_effective_target_frame_pointer_for_non_leaf): AArch64
> does not
> >     require frame pointer for non-leaf functions.
> Yea, the OK still applies.
> jeff
diff --git a/gcc/testsuite/c-c++-common/ubsan/vla-1.c b/gcc/testsuite/c-c++-common/ubsan/vla-1.c
index 52ade3aab7566dce3ca7ef931ac65895005d5e13..c97465edae195442a71ee66ab25015a2ac4fc8fc 100644
--- a/gcc/testsuite/c-c++-common/ubsan/vla-1.c
+++ b/gcc/testsuite/c-c++-common/ubsan/vla-1.c
@@ -1,5 +1,5 @@
 /* { dg-do run } */
-/* { dg-options "-fsanitize=vla-bound -Wall -Wno-unused-variable" } */
+/* { dg-options "-fsanitize=vla-bound -Wall -Wno-unused-variable -fno-stack-clash-protection" } */
 
 typedef long int V;
 int x = -1;
diff --git a/gcc/testsuite/gcc.dg/params/blocksort-part.c b/gcc/testsuite/gcc.dg/params/blocksort-part.c
index a9154f2e61ccd21b60153f20be3891b988f9ef2c..1e677878e7bd9c68b026f8c72b0de9f01e15459c 100644
--- a/gcc/testsuite/gcc.dg/params/blocksort-part.c
+++ b/gcc/testsuite/gcc.dg/params/blocksort-part.c
@@ -1,3 +1,4 @@
+/* { dg-skip-if "AArch64 does not support these bounds." { aarch64*-*-* } { "--param stack-clash-protection-*" } } */
 
 /*-------------------------------------------------------------*/
 /*--- Block sorting machinery                               ---*/
diff --git a/gcc/testsuite/gcc.dg/pr82788.c b/gcc/testsuite/gcc.dg/pr82788.c
index a8f628fd7f66c3e56739f6ff491df38b23f4d4df..41c442f61a625c8b350e1e4c870a98d86b167031 100644
--- a/gcc/testsuite/gcc.dg/pr82788.c
+++ b/gcc/testsuite/gcc.dg/pr82788.c
@@ -1,4 +1,5 @@
 /* { dg-do run } */
 /* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-probe-interval=10 --param stack-clash-protection-guard-size=12" } */
 /* { dg-require-effective-target supports_stack_clash_protection } */
+/* { dg-skip-if "AArch64 does not support this interval." { aarch64*-*-* } } */
 int main() { int a[1442]; return 0;}
diff --git a/gcc/testsuite/gcc.dg/stack-check-10.c b/gcc/testsuite/gcc.dg/stack-check-10.c
index a86956ad6925464e4a938a33e609fae5004201c7..2f5a090cb7a4ed6d2e6e4317492150a348a326ab 100644
--- a/gcc/testsuite/gcc.dg/stack-check-10.c
+++ b/gcc/testsuite/gcc.dg/stack-check-10.c
@@ -39,3 +39,4 @@ f3 (void)
    need a frame pointer.  Otherwise neither should.  */
 /* { dg-final { scan-rtl-dump-times "Stack clash no frame pointer needed" 2 "pro_and_epilogue" { target { ! frame_pointer_for_non_leaf } } } } */
 /* { dg-final { scan-rtl-dump-times "Stack clash frame pointer needed" 2 "pro_and_epilogue" { target { frame_pointer_for_non_leaf } } } } */
+/* { dg-final { scan-rtl-dump-times "Stack clash no probe small stack adjustment in prologue" 2 "pro_and_epilogue" { target { aarch64*-*-* } } } } */
diff --git a/gcc/testsuite/gcc.dg/stack-check-5.c b/gcc/testsuite/gcc.dg/stack-check-5.c
index 604fa3cf6c5b502f74c1e3497b3b8d72a15bb3ea..0243147939c10e8f4632520b12714724af85b332 100644
--- a/gcc/testsuite/gcc.dg/stack-check-5.c
+++ b/gcc/testsuite/gcc.dg/stack-check-5.c
@@ -66,7 +66,9 @@ f3 (void)
 /* { dg-final { scan-rtl-dump-times "Stack clash no frame pointer needed" 4 "pro_and_epilogue" { target { ! frame_pointer_for_non_leaf } } } } */
 /* { dg-final { scan-rtl-dump-times "Stack clash no frame pointer needed" 2 "pro_and_epilogue" { target { frame_pointer_for_non_leaf } } } } */
 /* { dg-final { scan-rtl-dump-times "Stack clash frame pointer needed" 2 "pro_and_epilogue" { target { frame_pointer_for_non_leaf } } } } */
-
+/* AArch64 won't require a probe here due to the allocation amount being less than 1KB.  */
+/* { dg-final { scan-rtl-dump-times "Stack clash no probe small stack adjustment in prologue" 3 "pro_and_epilogue" { target { aarch64*-*-* } } } } */
+/* { dg-final { scan-rtl-dump-times "Stack clash no probe no stack adjustment in prologue" 1 "pro_and_epilogue" { target { aarch64*-*-* } } } } */
 
 /* We have selected the size of the array in f2/f3 to be large enough
    to not live in the red zone on targets that support it.
diff --git a/gcc/testsuite/gcc.dg/stack-check-6a.c b/gcc/testsuite/gcc.dg/stack-check-6a.c
index 8fb9c621585957a85877ebadfbc4a8daabe4311c..68dd9bc48a0c26ecb84ddd2c09b8aa74d3276695 100644
--- a/gcc/testsuite/gcc.dg/stack-check-6a.c
+++ b/gcc/testsuite/gcc.dg/stack-check-6a.c
@@ -5,6 +5,7 @@
 /* { dg-options "-O2 -fstack-clash-protection -fdump-rtl-pro_and_epilogue -fno-optimize-sibling-calls --param stack-clash-protection-probe-interval=12 --param stack-clash-protection-guard-size=16" } */
 /* { dg-require-effective-target supports_stack_clash_protection  } */
 /* { dg-skip-if "" { *-*-* } { "-fstack-protector*" } { "" } } */
+/* { dg-skip-if "" { aarch64*-*-* } } */
 
 
 #include "stack-check-6.c"
diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-12.c b/gcc/testsuite/gcc.target/aarch64/stack-check-12.c
index 4e3abcbcef2eb216be9f0e01b4f1713c33f8b0b8..be5a57a9ec6bb0a866ab57571d06912731d76c7a 100644
--- a/gcc/testsuite/gcc.target/aarch64/stack-check-12.c
+++ b/gcc/testsuite/gcc.target/aarch64/stack-check-12.c
@@ -2,12 +2,14 @@
 /* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16 -fno-asynchronous-unwind-tables -fno-unwind-tables" } */
 /* { dg-require-effective-target supports_stack_clash_protection } */
 
-extern void arf (unsigned long int *, unsigned long int *);
+typedef unsigned __attribute__((mode(DI))) uint64_t;
+
+extern void arf (uint64_t *, uint64_t *);
 void
 frob ()
 {
-  unsigned long int num[10000];
-  unsigned long int den[10000];
+  uint64_t num[10000];
+  uint64_t den[10000];
   arf (den, num);
 }
 
diff --git a/gcc/testsuite/gcc.target/aarch64/subsp.c b/gcc/testsuite/gcc.target/aarch64/subsp.c
index 70d848c59d1f1e4df4314ca012c7a5d9d3b91ebc..6ef6b2c90ae694055749a94b68cbba5ee4aea882 100644
--- a/gcc/testsuite/gcc.target/aarch64/subsp.c
+++ b/gcc/testsuite/gcc.target/aarch64/subsp.c
@@ -1,4 +1,4 @@
-/* { dg-options "-O" } */
+/* { dg-options "-O -fno-stack-clash-protection" } */
 
 int foo (void *);
 
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 7f33ce8a3efabc8a9144a83ee326120415fd38f7..7e9e89175071e2b93128c7423dc2b72510f3aa6d 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -9341,10 +9341,6 @@ proc check_effective_target_supports_stack_clash_protection { } {
 # Return 1 if the target creates a frame pointer for non-leaf functions
 # Note we ignore cases where we apply tail call optimization here.
 proc check_effective_target_frame_pointer_for_non_leaf { } {
-  if { [istarget aarch*-*-*] } {
-	return 1
-  }
-
   # Solaris/x86 defaults to -fno-omit-frame-pointer.
   if { [istarget i?86-*-solaris*] || [istarget x86_64-*-solaris*] } {
     return 1

Reply via email to