2019-08-16 Alexandre Oliva <oliva@adacore.com>
+ * gcc.target/arc/interrupt-6.c: Use __builtin_alloca, require
+ effective target support for alloca, drop include of alloca.h.
+ * gcc.target/i386/pr80969-3.c: Likewise.
+ * gcc.target/sparc/setjmp-1.c: Likewise.
+ * gcc.target/x86_64/abi/ms-sysv/gen.cc: Likewise.
+ * gcc.target/x86_64/abi/ms-sysv/ms-sysv.c: Likewise.
+
* gcc.misc-tests/options.exp: Match /ld and -ld besides
/collect2.
/* { dg-do compile } */
/* { dg-skip-if "Not available for ARCv1" { arc700 || arc6xx } } */
/* { dg-options "-O2 -mirq-ctrl-saved=r0-ilink" } */
-
-#include <alloca.h>
+/* { dg-require-effective-target alloca } */
/* Check if ilink is recognized. Check how FP and BLINK are saved.
BLINK is saved last on the stack because the IRQ autosave will do
void __attribute__ ((interrupt("ilink")))
foo(void)
{
- int *p = alloca (10);
+ int *p = __builtin_alloca (10);
bar (p);
}
/* { dg-final { scan-assembler-not ".*fp,\\\[sp" } } */
/* { dg-do compile { target { { ! x32 } && { ! avx512f_runtime } } } } */
/* { dg-options "-Ofast -mabi=ms -mavx512f" } */
/* { dg-require-effective-target avx512f } */
+/* { dg-require-effective-target alloca } */
/* Test with alloca (and DRAP). */
-#include <alloca.h>
-
int a[56];
volatile int b = -12345;
volatile const int d = 42;
int main (int argc, char *argv[]) {
int c;
- int *e = alloca (d);
+ int *e = __builtin_alloca (d);
foo_noinfo (e, d, 0);
for (; b; b++) {
c = b;
/* { dg-do run { target *-*-solaris2.* *-*-linux* *-*-*bsd* } } */\r
/* { dg-require-effective-target fpic } */\r
/* { dg-options "-fPIC" } */\r
+/* { dg-require-effective-target alloca } */\r
\r
#include <stdio.h>\r
-#include <alloca.h>\r
#include <setjmp.h>\r
#include <string.h>\r
#include <stdlib.h>\r
{\r
setjmp (jb);\r
\r
- char *p = alloca (256);\r
+ char *p = __builtin_alloca (256);\r
memset (p, 0, 256);\r
sprintf (p, "%d\n", foo);\r
\r
if (get_msabi () && get_alloca ())
{
const char *size_str = m_args.empty () ? "42" : "a";
- out << " void *alloca_mem = alloca (8 + " << size_str << ");" << endl
+ out << " void *alloca_mem = __builtin_alloca (8 + " << size_str << ");" << endl
<< " *(long*)alloca_mem = FLAG_ALLOCA;" << endl;
}
if (get_msabi () && get_varargs ())
/* { dg-do run } */
/* { dg-additional-sources "do-test.S" } */
/* { dg-additional-options "-Wall" } */
+/* { dg-require-effective-target alloca } */
#include <stdio.h>
#include <string.h>
#include <signal.h>
#include <unistd.h>
#include <stdint.h>
-#include <alloca.h>
#include <stdarg.h>
#include <assert.h>
#include <errno.h>