* lib/target-supports.exp (check_effective_target_alloca): New function.
* gcc.c-torture/execute/
20010209-1.c: Require alloca.
* gcc.c-torture/execute/
20020314-1.c: Likewise.
* gcc.c-torture/execute/
20020412-1.c: Likewise.
* gcc.c-torture/execute/
20021113-1.c: Likewise.
* gcc.c-torture/execute/
20040223-1.c: Likewise.
* gcc.c-torture/execute/
20040308-1.c: Likewise.
* gcc.c-torture/execute/
20040811-1.c: Likewise.
* gcc.c-torture/execute/
20070824-1.c: Likewise.
* gcc.c-torture/execute/
20070919-1.c: Likewise.
* gcc.c-torture/execute/built-in-setjmp.c: Likewise.
* gcc.c-torture/execute/pr22061-1.c: Likewise.
* gcc.c-torture/execute/pr22061-4.c: Likewise.
* gcc.c-torture/execute/pr43220.c: Likewise.
* gcc.c-torture/execute/vla-dealloc-1.c: Likewise.
* gcc.dg/torture/stackalign/alloca-1.c: Likewise.
* gcc.dg/torture/stackalign/vararg-1.c: Likewise.
* gcc.dg/torture/stackalign/vararg-2.c: Likewise.
* gcc.c-torture/compile/
20000923-1.c: Likewise.
* gcc.c-torture/compile/
20030224-1.c: Likewise.
* gcc.c-torture/compile/
20071108-1.c: Likewise.
* gcc.c-torture/compile/
20071117-1.c: Likewise.
* gcc.c-torture/compile/900313-1.c: Likewise.
* gcc.c-torture/compile/pr17397.c: Likewise.
* gcc.c-torture/compile/pr35006.c: Likewise.
* gcc.c-torture/compile/pr42956.c: Likewise.
* gcc.c-torture/compile/pr51354.c: Likewise.
* gcc.c-torture/compile/pr55851.c: Likewise.
* gcc.c-torture/compile/vla-const-1.c: Likewise.
* gcc.c-torture/compile/vla-const-2.c: Likewise.
* gcc.c-torture/compile/pr31507-1.c: Likewise.
* gcc.c-torture/compile/pr52714.c: Likewise.
* gcc.dg/
20001012-2.c: Likewise.
* gcc.dg/auto-type-1.c: Likewise.
* gcc.dg/builtin-object-size-1.c: Likewise.
* gcc.dg/builtin-object-size-2.c: Likewise.
* gcc.dg/builtin-object-size-3.c: Likewise.
* gcc.dg/builtin-object-size-4.c: Likewise.
* gcc.dg/packed-vla.c: Likewise.
* gcc.c-torture/compile/parms.c: Likewise.
* gcc.c-torture/execute/920721-2.c: Skip -O0 unless alloca is available.
* gcc.c-torture/execute/920929-1.c: Likewise.
* gcc.c-torture/execute/921017-1.c: Likewise.
* gcc.c-torture/execute/941202-1.c: Likewise.
* gcc.c-torture/execute/align-nest.c: Likewise.
* gcc.c-torture/execute/alloca-1.c: Likewise.
* gcc.c-torture/execute/pr36321.c: Likewise.
* gcc.c-torture/compile/
20001221-1.c: Likewise.
* gcc.c-torture/compile/
20020807-1.c: Likewise.
* gcc.c-torture/compile/
20050801-2.c: Likewise.
* gcc.c-torture/compile/920428-4.c: Likewise.
* gcc.c-torture/compile/debugvlafunction-1.c.c: Likewise.
* gcc.c-torture/compile/pr41469.c: Likewise.
* gcc.dg/torture/pr48953.c: Likewise.
* gcc.dg/torture/pr8081.c: Likewise.
* gcc.dg/torture/stackalign/inline-1.c: Skip if nvptx-*-*.
* gcc.dg/torture/stackalign/inline-2.c: Likewise.
* gcc.dg/torture/stackalign/nested-1.c: Likewise.
* gcc.dg/torture/stackalign/nested-2.c: Likewise.
* gcc.dg/torture/stackalign/nested-3.c: Likewise.
* gcc.dg/torture/stackalign/nested-4.c: Likewise.
* gcc.dg/torture/stackalign/nested-1.c: Likewise.
* gcc.dg/torture/stackalign/global-1.c: Likewise.
* gcc.dg/torture/stackalign/pr16660-1.c: Likewise.
* gcc.dg/torture/stackalign/pr16660-2.c: Likewise.
* gcc.dg/torture/stackalign/pr16660-3.c: Likewise.
* gcc.dg/torture/stackalign/ret-struct-1.c: Likewise.
* gcc.dg/torture/stackalign/struct-1.c: Likewise.
From-SVN: r217296
+2014-11-10 Bernd Schmidt <bernds@codesourcery.com>
+
+ * lib/target-supports.exp (check_effective_target_alloca): New function.
+ * gcc.c-torture/execute/20010209-1.c: Require alloca.
+ * gcc.c-torture/execute/20020314-1.c: Likewise.
+ * gcc.c-torture/execute/20020412-1.c: Likewise.
+ * gcc.c-torture/execute/20021113-1.c: Likewise.
+ * gcc.c-torture/execute/20040223-1.c: Likewise.
+ * gcc.c-torture/execute/20040308-1.c: Likewise.
+ * gcc.c-torture/execute/20040811-1.c: Likewise.
+ * gcc.c-torture/execute/20070824-1.c: Likewise.
+ * gcc.c-torture/execute/20070919-1.c: Likewise.
+ * gcc.c-torture/execute/built-in-setjmp.c: Likewise.
+ * gcc.c-torture/execute/pr22061-1.c: Likewise.
+ * gcc.c-torture/execute/pr22061-4.c: Likewise.
+ * gcc.c-torture/execute/pr43220.c: Likewise.
+ * gcc.c-torture/execute/vla-dealloc-1.c: Likewise.
+ * gcc.dg/torture/stackalign/alloca-1.c: Likewise.
+ * gcc.dg/torture/stackalign/vararg-1.c: Likewise.
+ * gcc.dg/torture/stackalign/vararg-2.c: Likewise.
+ * gcc.c-torture/compile/20000923-1.c: Likewise.
+ * gcc.c-torture/compile/20030224-1.c: Likewise.
+ * gcc.c-torture/compile/20071108-1.c: Likewise.
+ * gcc.c-torture/compile/20071117-1.c: Likewise.
+ * gcc.c-torture/compile/900313-1.c: Likewise.
+ * gcc.c-torture/compile/pr17397.c: Likewise.
+ * gcc.c-torture/compile/pr35006.c: Likewise.
+ * gcc.c-torture/compile/pr42956.c: Likewise.
+ * gcc.c-torture/compile/pr51354.c: Likewise.
+ * gcc.c-torture/compile/pr55851.c: Likewise.
+ * gcc.c-torture/compile/vla-const-1.c: Likewise.
+ * gcc.c-torture/compile/vla-const-2.c: Likewise.
+ * gcc.c-torture/compile/pr31507-1.c: Likewise.
+ * gcc.c-torture/compile/pr52714.c: Likewise.
+ * gcc.dg/20001012-2.c: Likewise.
+ * gcc.dg/auto-type-1.c: Likewise.
+ * gcc.dg/builtin-object-size-1.c: Likewise.
+ * gcc.dg/builtin-object-size-2.c: Likewise.
+ * gcc.dg/builtin-object-size-3.c: Likewise.
+ * gcc.dg/builtin-object-size-4.c: Likewise.
+ * gcc.dg/packed-vla.c: Likewise.
+ * gcc.c-torture/compile/parms.c: Likewise.
+ * gcc.c-torture/execute/920721-2.c: Skip -O0 unless alloca is available.
+ * gcc.c-torture/execute/920929-1.c: Likewise.
+ * gcc.c-torture/execute/921017-1.c: Likewise.
+ * gcc.c-torture/execute/941202-1.c: Likewise.
+ * gcc.c-torture/execute/align-nest.c: Likewise.
+ * gcc.c-torture/execute/alloca-1.c: Likewise.
+ * gcc.c-torture/execute/pr36321.c: Likewise.
+ * gcc.c-torture/compile/20001221-1.c: Likewise.
+ * gcc.c-torture/compile/20020807-1.c: Likewise.
+ * gcc.c-torture/compile/20050801-2.c: Likewise.
+ * gcc.c-torture/compile/920428-4.c: Likewise.
+ * gcc.c-torture/compile/debugvlafunction-1.c.c: Likewise.
+ * gcc.c-torture/compile/pr41469.c: Likewise.
+ * gcc.dg/torture/pr48953.c: Likewise.
+ * gcc.dg/torture/pr8081.c: Likewise.
+ * gcc.dg/torture/stackalign/inline-1.c: Skip if nvptx-*-*.
+ * gcc.dg/torture/stackalign/inline-2.c: Likewise.
+ * gcc.dg/torture/stackalign/nested-1.c: Likewise.
+ * gcc.dg/torture/stackalign/nested-2.c: Likewise.
+ * gcc.dg/torture/stackalign/nested-3.c: Likewise.
+ * gcc.dg/torture/stackalign/nested-4.c: Likewise.
+ * gcc.dg/torture/stackalign/nested-1.c: Likewise.
+ * gcc.dg/torture/stackalign/global-1.c: Likewise.
+ * gcc.dg/torture/stackalign/pr16660-1.c: Likewise.
+ * gcc.dg/torture/stackalign/pr16660-2.c: Likewise.
+ * gcc.dg/torture/stackalign/pr16660-3.c: Likewise.
+ * gcc.dg/torture/stackalign/ret-struct-1.c: Likewise.
+ * gcc.dg/torture/stackalign/struct-1.c: Likewise.
+
2014-11-10 Edward Smith-Rowland <3dw4rd@verizon.net>
* g++.dg/cpp1y/feat-cxx11.C: Test new feature macros for C++98
+/* { dg-require-effective-target alloca } */
const int a = 3;
const int b = 50;
+/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
static void
foo ()
{
+/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
int x;
static int
+/* { dg-require-effective-target alloca } */
void zzz (char *s1, char *s2, int len, int *q)
{
int z = 5;
+/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
__inline int f(int i)
{
struct {
/* PR tree-optimization/33680 */
+/* { dg-require-effective-target alloca } */
int
f (int dim, int *b, int *c)
/* PR middle-end/34134 */
+/* { dg-require-effective-target alloca } */
extern void bar (void *, int);
+/* { dg-require-effective-target alloca } */
main ()
{
char *a;
+/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
x(a){struct{int p[a],i;}l;l.i;}
+/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
extern void dynreplace_trampoline(void);
extern void dynreplace_trampoline_endlabel(void);
int dynreplace_add_trampoline(void)
+/* { dg-require-effective-target alloca } */
#define alloca __builtin_alloca
x (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, x, y)
/* ICE due to invalid GIMPLE created during strlen simplification. */
+/* { dg-require-effective-target alloca } */
extern unsigned long strlen (__const char *__s);
extern void bar ();
+/* { dg-require-effective-target alloca } */
typedef unsigned long grub_uint64_t;
typedef grub_uint64_t grub_size_t;
grub_cmdline_get (unsigned max_len, int echo_char)
/* { dg-options "-fexceptions" } */
+/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
void
af (void *a)
+/* { dg-require-effective-target alloca } */
typedef const int cint;
typedef struct {
} Bounds;
/* PR target/51354 */
+/* { dg-require-effective-target alloca } */
extern void abort (void);
+/* { dg-require-effective-target alloca } */
int __re_compile_fastmap(unsigned char *p)
{
/* PR middle-end/55851 */
+/* { dg-require-effective-target alloca } */
enum { A = 1UL, B = -1UL } var = A;
void foo (char *);
/* Test TREE_CONSTANT VLA size: bug 27893. */
/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-require-effective-target alloca } */
int a;
void g(void *);
void f(void) { int b[(__SIZE_TYPE__)&a]; g(b); }
/* Test TREE_CONSTANT VLA size: bug 27893. */
/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-require-effective-target alloca } */
void g(void *);
void f(void) { int b[1/0]; g(b); }
+/* { dg-require-effective-target alloca } */
int b;
int foo (void)
{
+/* { dg-require-effective-target alloca } */
void f(void * a, double y)
{
}
/* PR c/3711
This testcase ICEd on IA-32 at -O0 and was miscompiled otherwise,
because std_expand_builtin_va_arg didn't handle variable size types. */
+/* { dg-require-effective-target alloca } */
#include <stdarg.h>
+/* { dg-require-effective-target alloca } */
+
/* This program tests a data flow bug that would cause constant propagation
to propagate constants through function calls. */
+/* { dg-require-effective-target alloca } */
#include <string.h>
#include <stdio.h>
+/* { dg-require-effective-target alloca } */
/* This used to fail on SPARC with an unaligned memory access. */
void foo(int n)
/* { dg-require-effective-target int32plus } */
+/* { dg-require-effective-target alloca } */
/* Ensure that we deallocate X when branching back before its
declaration. */
/* PR tree-optimization/33136 */
+/* { dg-require-effective-target alloca } */
extern void abort (void);
/* PR c/33238 */
+/* { dg-require-effective-target alloca } */
typedef __SIZE_TYPE__ size_t;
int memcmp (const void *, const void *, size_t);
+/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
f(){}
main(){int n=2;double x[n];f();exit(0);}
+/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
/* REPRODUCED:RUN:SIGNAL MACHINE:sparc OPTIONS: */
f(int n)
{
+/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
f(n)
{
int a[n];
+/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
g (x, y)
{
if (x != 3)
+/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
void foo(int n)
{
+/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
/* Verify that alloca storage is sufficiently aligned. */
/* ??? May fail if BIGGEST_ALIGNMENT > STACK_BOUNDARY. Which, I guess
can only happen on !STRICT_ALIGNMENT targets. */
+/* { dg-require-effective-target alloca } */
+
extern int strcmp(const char *, const char *);
extern char *strcpy(char *, const char *);
extern void abort(void);
+/* { dg-require-effective-target alloca } */
int N = 1;
void foo() {} /* Necessary to trigger the original ICE. */
void bar (char a[2][N]) { a[1][0] = N; }
+/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
void
bar (int N)
{
+/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
extern void abort (void);
extern __SIZE_TYPE__ strlen (const char *);
/* { dg-require-effective-target int32plus } */
+/* { dg-require-effective-target alloca } */
void *volatile p;
/* VLAs should be deallocated on a jump to before their definition,
including a jump to a label in an inner scope. PR 19771. */
+/* { dg-require-effective-target alloca } */
#if (__SIZEOF_INT__ <= 2)
#define LIMIT 10000
/* { dg-do run { target fpic } } */
/* { dg-options "-O2 -fpic" } */
+/* { dg-require-effective-target alloca } */
extern void abort (void);
extern void exit (int);
/* Test __auto_type. Test correct uses. */
/* { dg-do run } */
/* { dg-options "" } */
+/* { dg-require-effective-target alloca } */
extern void abort (void);
extern void exit (int);
/* { dg-do run } */
/* { dg-options "-O2" } */
+/* { dg-require-effective-target alloca } */
typedef __SIZE_TYPE__ size_t;
extern void abort (void);
/* { dg-do run } */
/* { dg-options "-O2" } */
+/* { dg-require-effective-target alloca } */
typedef __SIZE_TYPE__ size_t;
extern void abort (void);
/* { dg-do run } */
/* { dg-options "-O2" } */
+/* { dg-require-effective-target alloca } */
typedef __SIZE_TYPE__ size_t;
extern void abort (void);
/* { dg-do run } */
/* { dg-options "-O2" } */
+/* { dg-require-effective-target alloca } */
typedef __SIZE_TYPE__ size_t;
extern void abort (void);
/* PR middle-end/27945 */
/* { dg-do run } */
/* { dg-options "" } */
+/* { dg-require-effective-target alloca } */
extern int printf (const char *, ...);
extern void abort ();
/* PR target/31507 */
/* { dg-do run } */
/* { dg-options "-Os -fno-omit-frame-pointer" } */
+/* { dg-require-effective-target alloca } */
extern void abort (void);
/* { dg-do run } */
/* { dg-options "-fno-tree-dce" } */
+/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
static inline int foo (int n, int k)
{
/* { dg-do run } */
+/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
extern void abort (void);
int
/* { dg-do run } */
/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */
+/* { dg-require-effective-target alloca } */
#include "check.h"
/* { dg-do run } */
/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */
+/* { dg-skip-if "Stack alignment causes use of alloca" { nvptx-*-* } "*" "" } */
#include "check.h"
/* { dg-do run } */
/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */
+/* { dg-skip-if "Stack alignment causes use of alloca" { nvptx-*-* } "*" "" } */
#include "check.h"
/* { dg-do run } */
/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */
+/* { dg-require-effective-target alloca } */
#include "check.h"
/* { dg-do run } */
/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */
+/* { dg-skip-if "Stack alignment causes use of alloca" { nvptx-*-* } "*" "" } */
#include "check.h"
/* { dg-do run } */
/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */
+/* { dg-skip-if "Stack alignment causes use of alloca" { nvptx-*-* } "*" "" } */
#include "check.h"
/* { dg-do run } */
/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */
+/* { dg-require-effective-target alloca } */
#include "check.h"
/* { dg-do run } */
/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */
+/* { dg-skip-if "Stack alignment causes use of alloca" { nvptx-*-* } "*" "" } */
#include "check.h"
/* { dg-do run } */
/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */
+/* { dg-skip-if "Stack alignment causes use of alloca" { nvptx-*-* } "*" "" } */
#include "check.h"
/* { dg-do run } */
+/* { dg-skip-if "Stack alignment causes use of alloca" { nvptx-*-* } "*" "" } */
#include "check.h"
/* { dg-do run } */
+/* { dg-skip-if "Stack alignment causes use of alloca" { nvptx-*-* } "*" "" } */
#include "check.h"
/* { dg-do run } */
/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */
+/* { dg-skip-if "Stack alignment causes use of alloca" { nvptx-*-* } "*" "" } */
#include "check.h"
/* { dg-do run } */
/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */
+/* { dg-skip-if "Stack alignment causes use of alloca" { nvptx-*-* } "*" "" } */
#include "check.h"
/* { dg-do run } */
/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */
+/* { dg-require-effective-target alloca } */
#include <stdarg.h>
#include "check.h"
/* { dg-do run } */
/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */
+/* { dg-require-effective-target alloca } */
#include <stdarg.h>
#include "check.h"
return $flags
}
+# Return 1 if alloca is supported, 0 otherwise.
+
+proc check_effective_target_alloca {} {
+ if { [istarget nvptx-*-*] } {
+ return 0
+ }
+ return 1
+}
+
# Return 1 if thread local storage (TLS) is supported, 0 otherwise.
proc check_effective_target_tls {} {