Testsuite alloca fixes for ptx.

* 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
This commit is contained in:
Bernd Schmidt 2014-11-10 16:30:09 +00:00 committed by Bernd Schmidt
parent 738f25224b
commit e2acc079ff
68 changed files with 148 additions and 0 deletions

View File

@ -1,3 +1,74 @@
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

View File

@ -1,3 +1,4 @@
/* { dg-require-effective-target alloca } */
const int a = 3;
const int b = 50;

View File

@ -1,3 +1,4 @@
/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
static void
foo ()
{

View File

@ -1,3 +1,4 @@
/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
int x;
static int

View File

@ -1,3 +1,4 @@
/* { dg-require-effective-target alloca } */
void zzz (char *s1, char *s2, int len, int *q)
{
int z = 5;

View File

@ -1,3 +1,4 @@
/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
__inline int f(int i)
{
struct {

View File

@ -1,4 +1,5 @@
/* PR tree-optimization/33680 */
/* { dg-require-effective-target alloca } */
int
f (int dim, int *b, int *c)

View File

@ -1,4 +1,5 @@
/* PR middle-end/34134 */
/* { dg-require-effective-target alloca } */
extern void bar (void *, int);

View File

@ -1,3 +1,4 @@
/* { dg-require-effective-target alloca } */
main ()
{
char *a;

View File

@ -1 +1,2 @@
/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
x(a){struct{int p[a],i;}l;l.i;}

View File

@ -1,3 +1,4 @@
/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
extern void dynreplace_trampoline(void);
extern void dynreplace_trampoline_endlabel(void);
int dynreplace_add_trampoline(void)

View File

@ -1,3 +1,4 @@
/* { 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)

View File

@ -1,4 +1,5 @@
/* ICE due to invalid GIMPLE created during strlen simplification. */
/* { dg-require-effective-target alloca } */
extern unsigned long strlen (__const char *__s);
extern void bar ();

View File

@ -1,3 +1,4 @@
/* { 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)

View File

@ -1,4 +1,5 @@
/* { dg-options "-fexceptions" } */
/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
void
af (void *a)

View File

@ -1,3 +1,4 @@
/* { dg-require-effective-target alloca } */
typedef const int cint;
typedef struct {
} Bounds;

View File

@ -1,4 +1,5 @@
/* PR target/51354 */
/* { dg-require-effective-target alloca } */
extern void abort (void);

View File

@ -1,3 +1,4 @@
/* { dg-require-effective-target alloca } */
int __re_compile_fastmap(unsigned char *p)
{

View File

@ -1,4 +1,5 @@
/* PR middle-end/55851 */
/* { dg-require-effective-target alloca } */
enum { A = 1UL, B = -1UL } var = A;
void foo (char *);

View File

@ -1,5 +1,6 @@
/* 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); }

View File

@ -1,4 +1,5 @@
/* 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); }

View File

@ -1,3 +1,4 @@
/* { dg-require-effective-target alloca } */
int b;
int foo (void)
{

View File

@ -1,3 +1,4 @@
/* { dg-require-effective-target alloca } */
void f(void * a, double y)
{
}

View File

@ -1,6 +1,7 @@
/* 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>

View File

@ -1,3 +1,5 @@
/* { dg-require-effective-target alloca } */
/* This program tests a data flow bug that would cause constant propagation
to propagate constants through function calls. */

View File

@ -1,3 +1,4 @@
/* { dg-require-effective-target alloca } */
#include <string.h>
#include <stdio.h>

View File

@ -1,3 +1,4 @@
/* { dg-require-effective-target alloca } */
/* This used to fail on SPARC with an unaligned memory access. */
void foo(int n)

View File

@ -1,4 +1,5 @@
/* { dg-require-effective-target int32plus } */
/* { dg-require-effective-target alloca } */
/* Ensure that we deallocate X when branching back before its
declaration. */

View File

@ -1,4 +1,5 @@
/* PR tree-optimization/33136 */
/* { dg-require-effective-target alloca } */
extern void abort (void);

View File

@ -1,4 +1,5 @@
/* PR c/33238 */
/* { dg-require-effective-target alloca } */
typedef __SIZE_TYPE__ size_t;
int memcmp (const void *, const void *, size_t);

View File

@ -1,2 +1,3 @@
/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
f(){}
main(){int n=2;double x[n];f();exit(0);}

View File

@ -1,3 +1,4 @@
/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
/* REPRODUCED:RUN:SIGNAL MACHINE:sparc OPTIONS: */
f(int n)
{

View File

@ -1,3 +1,4 @@
/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
f(n)
{
int a[n];

View File

@ -1,3 +1,4 @@
/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
g (x, y)
{
if (x != 3)

View File

@ -1,3 +1,4 @@
/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
void foo(int n)
{

View File

@ -1,3 +1,4 @@
/* { 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. */

View File

@ -1,3 +1,5 @@
/* { dg-require-effective-target alloca } */
extern int strcmp(const char *, const char *);
extern char *strcpy(char *, const char *);
extern void abort(void);

View File

@ -1,3 +1,4 @@
/* { 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; }

View File

@ -1,3 +1,4 @@
/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
void
bar (int N)
{

View File

@ -1,3 +1,4 @@
/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
extern void abort (void);
extern __SIZE_TYPE__ strlen (const char *);

View File

@ -1,4 +1,5 @@
/* { dg-require-effective-target int32plus } */
/* { dg-require-effective-target alloca } */
void *volatile p;

View File

@ -1,5 +1,6 @@
/* 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

View File

@ -1,5 +1,6 @@
/* { dg-do run { target fpic } } */
/* { dg-options "-O2 -fpic" } */
/* { dg-require-effective-target alloca } */
extern void abort (void);
extern void exit (int);

View File

@ -1,6 +1,7 @@
/* Test __auto_type. Test correct uses. */
/* { dg-do run } */
/* { dg-options "" } */
/* { dg-require-effective-target alloca } */
extern void abort (void);
extern void exit (int);

View File

@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2" } */
/* { dg-require-effective-target alloca } */
typedef __SIZE_TYPE__ size_t;
extern void abort (void);

View File

@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2" } */
/* { dg-require-effective-target alloca } */
typedef __SIZE_TYPE__ size_t;
extern void abort (void);

View File

@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2" } */
/* { dg-require-effective-target alloca } */
typedef __SIZE_TYPE__ size_t;
extern void abort (void);

View File

@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2" } */
/* { dg-require-effective-target alloca } */
typedef __SIZE_TYPE__ size_t;
extern void abort (void);

View File

@ -1,6 +1,7 @@
/* PR middle-end/27945 */
/* { dg-do run } */
/* { dg-options "" } */
/* { dg-require-effective-target alloca } */
extern int printf (const char *, ...);
extern void abort ();

View File

@ -1,6 +1,7 @@
/* PR target/31507 */
/* { dg-do run } */
/* { dg-options "-Os -fno-omit-frame-pointer" } */
/* { dg-require-effective-target alloca } */
extern void abort (void);

View File

@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-fno-tree-dce" } */
/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
static inline int foo (int n, int k)
{

View File

@ -1,4 +1,5 @@
/* { dg-do run } */
/* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
extern void abort (void);
int

View File

@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */
/* { dg-require-effective-target alloca } */
#include "check.h"

View File

@ -1,5 +1,6 @@
/* { 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"

View File

@ -1,5 +1,6 @@
/* { 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"

View File

@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */
/* { dg-require-effective-target alloca } */
#include "check.h"

View File

@ -1,5 +1,6 @@
/* { 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"

View File

@ -1,5 +1,6 @@
/* { 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"

View File

@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */
/* { dg-require-effective-target alloca } */
#include "check.h"

View File

@ -1,5 +1,6 @@
/* { 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"

View File

@ -1,5 +1,6 @@
/* { 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"

View File

@ -1,4 +1,5 @@
/* { dg-do run } */
/* { dg-skip-if "Stack alignment causes use of alloca" { nvptx-*-* } "*" "" } */
#include "check.h"

View File

@ -1,4 +1,5 @@
/* { dg-do run } */
/* { dg-skip-if "Stack alignment causes use of alloca" { nvptx-*-* } "*" "" } */
#include "check.h"

View File

@ -1,5 +1,6 @@
/* { 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"

View File

@ -1,5 +1,6 @@
/* { 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"

View File

@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */
/* { dg-require-effective-target alloca } */
#include <stdarg.h>
#include "check.h"

View File

@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */
/* { dg-require-effective-target alloca } */
#include <stdarg.h>
#include "check.h"

View File

@ -599,6 +599,15 @@ proc add_options_for_tls { flags } {
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 {} {