public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch] relax aarch64 stack-clash tests depedence on alloca.h
@ 2020-01-06 22:18 Olivier Hainque
  2020-01-06 22:25 ` Andrew Pinski
  0 siblings, 1 reply; 5+ messages in thread
From: Olivier Hainque @ 2020-01-06 22:18 UTC (permalink / raw)
  To: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 1456 bytes --]

Hello,

The aarch64 testsuite features a few tests for
the stack-clash-protection facility, all using "alloca"
after an #include <alloca.h>.

The use of alloca.h causes the tests to fail on
target systems not providing that header, such as some
variants of VxWorks.

My understanding is that the tests really depend on
the alloca functionality, not on alloca.h in particular.

This patch is a proposal to modify the tests to
use __builtin_alloca instead, as done in some other
places in the testsuite.

This cures the failures on VxWorks and bootstrap+regtest
fine on aarch64 linux.

Ok to commit ?

Thanks in advance!

Best Regards,

Olivier


2020-01-06  Olivier Hainque  <hainque@adacore.com>
	Alexandre Oliva  <oliva@adacore.com>

	* gcc.target/aarch64/stack-check-alloca.h: Remove
	#include alloca.h.
	(f_caller): Use __builtin_alloca instead of alloca.
	* gcc.target/aarch64/stack-check-alloca-1.c: Add
	{ dg-require-effective-target alloca }.
	* gcc.target/aarch64/stack-check-alloca-2.c: Likewise.
	* gcc.target/aarch64/stack-check-alloca-3.c: Likewise.
	* gcc.target/aarch64/stack-check-alloca-4.c: Likewise.
	* gcc.target/aarch64/stack-check-alloca-5.c: Likewise.
	* gcc.target/aarch64/stack-check-alloca-6.c: Likewise.
	* gcc.target/aarch64/stack-check-alloca-7.c: Likewise.
	* gcc.target/aarch64/stack-check-alloca-8.c: Likewise.
	* gcc.target/aarch64/stack-check-alloca-9.c: Likewise.
	* gcc.target/aarch64/stack-check-alloca-10.c: Likewise.


[-- Attachment #2: testsuite-aarch64-alloca.patch.txt --]
[-- Type: text/plain, Size: 6747 bytes --]

diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-1.c b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-1.c
index 7fc189f6210..e963ee66d36 100644
--- a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-1.c
+++ b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-1.c
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */
 /* { dg-require-effective-target supports_stack_clash_protection } */
+/* { dg-require-effective-target alloca } */
 
 #define SIZE y
 #include "stack-check-alloca.h"
diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-10.c b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-10.c
index 7c42206d315..eb85843565d 100644
--- a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-10.c
+++ b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-10.c
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */
 /* { dg-require-effective-target supports_stack_clash_protection } */
+/* { dg-require-effective-target alloca } */
 
 #define SIZE 127.5 * 64 * 1024
 #include "stack-check-alloca.h"
diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-2.c b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-2.c
index 69fdd16e35a..cc8216d2312 100644
--- a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-2.c
+++ b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-2.c
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */
 /* { dg-require-effective-target supports_stack_clash_protection } */
+/* { dg-require-effective-target alloca } */
 
 #define SIZE 0
 #include "stack-check-alloca.h"
diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-3.c b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-3.c
index fba3a7a25b7..f5e51fa4dc8 100644
--- a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-3.c
+++ b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-3.c
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */
 /* { dg-require-effective-target supports_stack_clash_protection } */
+/* { dg-require-effective-target alloca } */
 
 #define SIZE 100
 #include "stack-check-alloca.h"
diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-4.c b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-4.c
index d53f30a4133..c903f4d9998 100644
--- a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-4.c
+++ b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-4.c
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */
 /* { dg-require-effective-target supports_stack_clash_protection } */
+/* { dg-require-effective-target alloca } */
 
 #define SIZE 2 * 1024
 #include "stack-check-alloca.h"
diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-5.c b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-5.c
index e0ff99ffbe1..691ec23f89f 100644
--- a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-5.c
+++ b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-5.c
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */
 /* { dg-require-effective-target supports_stack_clash_protection } */
+/* { dg-require-effective-target alloca } */
 
 #define SIZE 63 * 1024
 #include "stack-check-alloca.h"
diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-6.c b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-6.c
index c4bad9a2f46..9e4af23ae24 100644
--- a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-6.c
+++ b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-6.c
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */
 /* { dg-require-effective-target supports_stack_clash_protection } */
+/* { dg-require-effective-target alloca } */
 
 #define SIZE 63.5 * 1024
 #include "stack-check-alloca.h"
diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-7.c b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-7.c
index cba9ff89c1a..f0ce2d8bd77 100644
--- a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-7.c
+++ b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-7.c
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */
 /* { dg-require-effective-target supports_stack_clash_protection } */
+/* { dg-require-effective-target alloca } */
 
 #define SIZE 64 * 1024
 #include "stack-check-alloca.h"
diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-8.c b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-8.c
index 5a35411b344..caaab04df52 100644
--- a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-8.c
+++ b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-8.c
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */
 /* { dg-require-effective-target supports_stack_clash_protection } */
+/* { dg-require-effective-target alloca } */
 
 #define SIZE 65 * 1024
 #include "stack-check-alloca.h"
diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-9.c b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-9.c
index 5773d8052bc..2c42e858100 100644
--- a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-9.c
+++ b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-9.c
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */
 /* { dg-require-effective-target supports_stack_clash_protection } */
+/* { dg-require-effective-target alloca } */
 
 #define SIZE 127 * 64 * 1024
 #include "stack-check-alloca.h"
diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca.h b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca.h
index a4f7fa2dd35..5e7406bf6ce 100644
--- a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca.h
+++ b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca.h
@@ -1,4 +1,3 @@
-#include <alloca.h>
 
 __attribute__((noinline, noipa))
 void g (char* ptr, int y)
@@ -8,6 +7,6 @@ void g (char* ptr, int y)
 
 void f_caller (int y)
 {
-  char* pStr = alloca(SIZE);
+  char* pStr = __builtin_alloca(SIZE);
   g (pStr, y);
-}
\ No newline at end of file
+}

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

* Re: [patch] relax aarch64 stack-clash tests depedence on alloca.h
  2020-01-06 22:18 [patch] relax aarch64 stack-clash tests depedence on alloca.h Olivier Hainque
@ 2020-01-06 22:25 ` Andrew Pinski
  2020-01-07 15:31   ` Olivier Hainque
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Pinski @ 2020-01-06 22:25 UTC (permalink / raw)
  To: Olivier Hainque; +Cc: GCC Patches

On Mon, Jan 6, 2020 at 2:18 PM Olivier Hainque <hainque@adacore.com> wrote:
>
> Hello,
>
> The aarch64 testsuite features a few tests for
> the stack-clash-protection facility, all using "alloca"
> after an #include <alloca.h>.
>
> The use of alloca.h causes the tests to fail on
> target systems not providing that header, such as some
> variants of VxWorks.
>
> My understanding is that the tests really depend on
> the alloca functionality, not on alloca.h in particular.
>
> This patch is a proposal to modify the tests to
> use __builtin_alloca instead, as done in some other
> places in the testsuite.
>
> This cures the failures on VxWorks and bootstrap+regtest
> fine on aarch64 linux.
>
> Ok to commit ?

Just one small suggestion:
Instead of:
-  char* pStr = alloca(SIZE);
+  char* pStr = __builtin_alloca(SIZE);

Why not just do:
-#include <alloca.h>
+#define alloca __builtin_alloca

Thanks,
Andrew Pinski


>
> Thanks in advance!
>
> Best Regards,
>
> Olivier
>
>
> 2020-01-06  Olivier Hainque  <hainque@adacore.com>
>         Alexandre Oliva  <oliva@adacore.com>
>
>         * gcc.target/aarch64/stack-check-alloca.h: Remove
>         #include alloca.h.
>         (f_caller): Use __builtin_alloca instead of alloca.
>         * gcc.target/aarch64/stack-check-alloca-1.c: Add
>         { dg-require-effective-target alloca }.
>         * gcc.target/aarch64/stack-check-alloca-2.c: Likewise.
>         * gcc.target/aarch64/stack-check-alloca-3.c: Likewise.
>         * gcc.target/aarch64/stack-check-alloca-4.c: Likewise.
>         * gcc.target/aarch64/stack-check-alloca-5.c: Likewise.
>         * gcc.target/aarch64/stack-check-alloca-6.c: Likewise.
>         * gcc.target/aarch64/stack-check-alloca-7.c: Likewise.
>         * gcc.target/aarch64/stack-check-alloca-8.c: Likewise.
>         * gcc.target/aarch64/stack-check-alloca-9.c: Likewise.
>         * gcc.target/aarch64/stack-check-alloca-10.c: Likewise.
>

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

* Re: [patch] relax aarch64 stack-clash tests depedence on alloca.h
  2020-01-06 22:25 ` Andrew Pinski
@ 2020-01-07 15:31   ` Olivier Hainque
  2020-01-07 17:21     ` Richard Sandiford
  0 siblings, 1 reply; 5+ messages in thread
From: Olivier Hainque @ 2020-01-07 15:31 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: Olivier Hainque, GCC Patches

[-- Attachment #1: Type: text/plain, Size: 1255 bytes --]

Hi Andrew,

> On 6 Jan 2020, at 23:24, Andrew Pinski <pinskia@gmail.com> wrote:
> Just one small suggestion:

Sure

> Instead of:
> -  char* pStr = alloca(SIZE);
> +  char* pStr = __builtin_alloca(SIZE);
> 
> Why not just do:
> -#include <alloca.h>
> +#define alloca __builtin_alloca

Yes, good idea.

Revised patch attached, where I also added a comment
explaining why we are doing this.

Re-tested on aarch64-linux.

Is this one ok ?

Thanks,

Olivier

2020-01-06  Olivier Hainque  <hainque@adacore.com>
	Alexandre Oliva  <oliva@adacore.com>

	* gcc.target/aarch64/stack-check-alloca.h: Remove
	#include alloca.h. #define alloca __builtin_alloca
	instead.
	* gcc.target/aarch64/stack-check-alloca-1.c: Add
	{ dg-require-effective-target alloca }.
	* gcc.target/aarch64/stack-check-alloca-2.c: Likewise.
	* gcc.target/aarch64/stack-check-alloca-3.c: Likewise.
	* gcc.target/aarch64/stack-check-alloca-4.c: Likewise.
	* gcc.target/aarch64/stack-check-alloca-5.c: Likewise.
	* gcc.target/aarch64/stack-check-alloca-6.c: Likewise.
	* gcc.target/aarch64/stack-check-alloca-7.c: Likewise.
	* gcc.target/aarch64/stack-check-alloca-8.c: Likewise.
	* gcc.target/aarch64/stack-check-alloca-9.c: Likewise.
	* gcc.target/aarch64/stack-check-alloca-10.c: Likewise.


[-- Attachment #2: 0001-Update-aarch64-stack-check-alloca-not-to-require-all.patch.txt --]
[-- Type: text/plain, Size: 6721 bytes --]

diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-1.c b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-1.c
index 7fc189f..e963ee6 100644
--- a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-1.c
+++ b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-1.c
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */
 /* { dg-require-effective-target supports_stack_clash_protection } */
+/* { dg-require-effective-target alloca } */
 
 #define SIZE y
 #include "stack-check-alloca.h"
diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-10.c b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-10.c
index 7c42206..eb85843 100644
--- a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-10.c
+++ b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-10.c
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */
 /* { dg-require-effective-target supports_stack_clash_protection } */
+/* { dg-require-effective-target alloca } */
 
 #define SIZE 127.5 * 64 * 1024
 #include "stack-check-alloca.h"
diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-2.c b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-2.c
index 69fdd16..cc8216d 100644
--- a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-2.c
+++ b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-2.c
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */
 /* { dg-require-effective-target supports_stack_clash_protection } */
+/* { dg-require-effective-target alloca } */
 
 #define SIZE 0
 #include "stack-check-alloca.h"
diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-3.c b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-3.c
index fba3a7a..f5e51fa 100644
--- a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-3.c
+++ b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-3.c
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */
 /* { dg-require-effective-target supports_stack_clash_protection } */
+/* { dg-require-effective-target alloca } */
 
 #define SIZE 100
 #include "stack-check-alloca.h"
diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-4.c b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-4.c
index d53f30a..c903f4d 100644
--- a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-4.c
+++ b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-4.c
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */
 /* { dg-require-effective-target supports_stack_clash_protection } */
+/* { dg-require-effective-target alloca } */
 
 #define SIZE 2 * 1024
 #include "stack-check-alloca.h"
diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-5.c b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-5.c
index e0ff99f..691ec23 100644
--- a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-5.c
+++ b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-5.c
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */
 /* { dg-require-effective-target supports_stack_clash_protection } */
+/* { dg-require-effective-target alloca } */
 
 #define SIZE 63 * 1024
 #include "stack-check-alloca.h"
diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-6.c b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-6.c
index c4bad9a..9e4af23 100644
--- a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-6.c
+++ b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-6.c
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */
 /* { dg-require-effective-target supports_stack_clash_protection } */
+/* { dg-require-effective-target alloca } */
 
 #define SIZE 63.5 * 1024
 #include "stack-check-alloca.h"
diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-7.c b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-7.c
index cba9ff8..f0ce2d8 100644
--- a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-7.c
+++ b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-7.c
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */
 /* { dg-require-effective-target supports_stack_clash_protection } */
+/* { dg-require-effective-target alloca } */
 
 #define SIZE 64 * 1024
 #include "stack-check-alloca.h"
diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-8.c b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-8.c
index 5a35411..caaab04 100644
--- a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-8.c
+++ b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-8.c
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */
 /* { dg-require-effective-target supports_stack_clash_protection } */
+/* { dg-require-effective-target alloca } */
 
 #define SIZE 65 * 1024
 #include "stack-check-alloca.h"
diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-9.c b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-9.c
index 5773d80..2c42e85 100644
--- a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-9.c
+++ b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-9.c
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */
 /* { dg-require-effective-target supports_stack_clash_protection } */
+/* { dg-require-effective-target alloca } */
 
 #define SIZE 127 * 64 * 1024
 #include "stack-check-alloca.h"
diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca.h b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca.h
index a4f7fa2..4cacd92 100644
--- a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca.h
+++ b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca.h
@@ -1,4 +1,7 @@
-#include <alloca.h>
+
+/* Avoid inclusion of alloca.h, which is unavailable
+   on some systems.  */
+#define alloca __builtin_alloca
 
 __attribute__((noinline, noipa))
 void g (char* ptr, int y)
@@ -10,4 +13,4 @@ void f_caller (int y)
 {
   char* pStr = alloca(SIZE);
   g (pStr, y);
-}
\ No newline at end of file
+}
-- 
1.9.1


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

* Re: [patch] relax aarch64 stack-clash tests depedence on alloca.h
  2020-01-07 15:31   ` Olivier Hainque
@ 2020-01-07 17:21     ` Richard Sandiford
  2020-01-08 15:39       ` Olivier Hainque
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Sandiford @ 2020-01-07 17:21 UTC (permalink / raw)
  To: Olivier Hainque; +Cc: Andrew Pinski, GCC Patches

Olivier Hainque <hainque@adacore.com> writes:
> Hi Andrew,
>
>> On 6 Jan 2020, at 23:24, Andrew Pinski <pinskia@gmail.com> wrote:
>> Just one small suggestion:
>
> Sure
>
>> Instead of:
>> -  char* pStr = alloca(SIZE);
>> +  char* pStr = __builtin_alloca(SIZE);
>> 
>> Why not just do:
>> -#include <alloca.h>
>> +#define alloca __builtin_alloca
>
> Yes, good idea.
>
> Revised patch attached, where I also added a comment
> explaining why we are doing this.
>
> Re-tested on aarch64-linux.
>
> Is this one ok ?
>
> Thanks,
>
> Olivier
>
> 2020-01-06  Olivier Hainque  <hainque@adacore.com>
> 	Alexandre Oliva  <oliva@adacore.com>
>
> 	* gcc.target/aarch64/stack-check-alloca.h: Remove
> 	#include alloca.h. #define alloca __builtin_alloca
> 	instead.
> 	* gcc.target/aarch64/stack-check-alloca-1.c: Add
> 	{ dg-require-effective-target alloca }.
> 	* gcc.target/aarch64/stack-check-alloca-2.c: Likewise.
> 	* gcc.target/aarch64/stack-check-alloca-3.c: Likewise.
> 	* gcc.target/aarch64/stack-check-alloca-4.c: Likewise.
> 	* gcc.target/aarch64/stack-check-alloca-5.c: Likewise.
> 	* gcc.target/aarch64/stack-check-alloca-6.c: Likewise.
> 	* gcc.target/aarch64/stack-check-alloca-7.c: Likewise.
> 	* gcc.target/aarch64/stack-check-alloca-8.c: Likewise.
> 	* gcc.target/aarch64/stack-check-alloca-9.c: Likewise.
> 	* gcc.target/aarch64/stack-check-alloca-10.c: Likewise.

OK, thanks.

Richard

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

* Re: [patch] relax aarch64 stack-clash tests depedence on alloca.h
  2020-01-07 17:21     ` Richard Sandiford
@ 2020-01-08 15:39       ` Olivier Hainque
  0 siblings, 0 replies; 5+ messages in thread
From: Olivier Hainque @ 2020-01-08 15:39 UTC (permalink / raw)
  To: Richard Sandiford; +Cc: Olivier Hainque, GCC Patches



> On 7 Jan 2020, at 18:21, Richard Sandiford <richard.sandiford@arm.com> wrote:

>> 	* gcc.target/aarch64/stack-check-alloca.h: Remove
>> 	#include alloca.h. #define alloca __builtin_alloca
>> 	instead.

> OK, thanks.

Great, thanks Richard!

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

end of thread, other threads:[~2020-01-08 15:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-06 22:18 [patch] relax aarch64 stack-clash tests depedence on alloca.h Olivier Hainque
2020-01-06 22:25 ` Andrew Pinski
2020-01-07 15:31   ` Olivier Hainque
2020-01-07 17:21     ` Richard Sandiford
2020-01-08 15:39       ` Olivier Hainque

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