+2020-01-08 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.
+
2020-01-08 Martin Liska <mliska@suse.cz>
* gcc.dg/ipa/ipa-icf-1.c: Update expected scanned output.
/* { 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"
/* { 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"
/* { 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"
/* { 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"
/* { 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"
/* { 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"
/* { 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"
/* { 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"
/* { 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"
/* { 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"
-#include <alloca.h>
+
+/* Avoid inclusion of alloca.h, unavailable on some systems. */
+#define alloca __builtin_alloca
__attribute__((noinline, noipa))
void g (char* ptr, int y)
{
char* pStr = alloca(SIZE);
g (pStr, y);
-}
\ No newline at end of file
+}