2017-06-21 Tom de Vries <tom@codesourcery.com>
* doc/sourcebuild.texi (Add Options, Features for dg-add-options): Add
stack_size feature.
(Effective-Target Keywords, Other attributes): Suggest using
dg-add-options stack_size feature to get stack limit in stack_size
effective target documentation.
* lib/target-supports.exp (add_options_for_stack_size): New proc.
* gcc.c-torture/execute/920501-7.c: Use dg-add-options stack_size.
* gcc.c-torture/compile/
20080806-1.c: Same.
* gcc.c-torture/compile/920723-1.c: Same.
* gcc.c-torture/compile/930621-1.c: Same.
* gcc.c-torture/compile/991214-2.c: Same.
* gcc.c-torture/compile/bcopy.c: Same.
* gcc.c-torture/compile/memtst.c: Same.
* gcc.c-torture/compile/msp.c: Same.
* gcc.c-torture/compile/stuct.c: Same.
* gcc.c-torture/execute/
20011008-3.c: Same.
* gcc.c-torture/execute/
20030209-1.c: Same.
* gcc.c-torture/execute/
20031012-1.c: Same.
* gcc.c-torture/execute/
20040805-1.c: Same.
* gcc.c-torture/execute/920410-1.c: Same.
* gcc.c-torture/execute/921113-1.c: Same.
* gcc.c-torture/execute/921202-1.c: Same.
* gcc.c-torture/execute/921208-2.c: Same.
* gcc.c-torture/execute/930106-1.c: Same.
* gcc.c-torture/execute/930406-1.c: Same.
* gcc.c-torture/execute/950221-1.c: Same.
* gcc.c-torture/execute/960521-1.c: Same.
* gcc.c-torture/execute/980605-1.c: Same.
* gcc.c-torture/execute/comp-goto-1.c: Same.
* gcc.c-torture/execute/comp-goto-2.c: Same.
* gcc.c-torture/execute/memcpy-1.c: Same.
* gcc.c-torture/execute/multi-ix.c: Same.
* gcc.c-torture/execute/nestfunc-4.c: Same.
* gcc.c-torture/execute/pr20621-1.c: Same.
* gcc.c-torture/execute/pr23135.c: Same.
* gcc.c-torture/execute/pr28982b.c: Same.
* gcc.dg/loop-3.c: Same.
* gcc.dg/struct-ret-3.c: Same.
* gcc.dg/torture/stackalign/comp-goto-1.c: Same.
* gcc.dg/torture/stackalign/non-local-goto-4.c: Same.
* gcc.dg/tree-prof/comp-goto-1.c: Same.
* gcc.dg/tree-prof/pr44777.c: Same.
From-SVN: r249440
+2017-06-21 Tom de Vries <tom@codesourcery.com>
+
+ * doc/sourcebuild.texi (Add Options, Features for dg-add-options): Add
+ stack_size feature.
+ (Effective-Target Keywords, Other attributes): Suggest using
+ dg-add-options stack_size feature to get stack limit in stack_size
+ effective target documentation.
+
2017-06-21 Julian Brown <julian@codesourcery.com>
Naveen H.S <Naveen.Hurugalawadi@cavium.com>
Target defaults to short enums.
@item stack_size
-Target has limited stack size. The stack size limit can be obtained using
-@code{[dg-effective-target-value stack_size]}. For example:
-@smallexample
-/* @{ dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" @{ target @{ stack_size @} @} @} */
-@end smallexample
+@anchor{stack_size_et}
+Target has limited stack size. The stack size limit can be obtained using the
+STACK_SIZE macro defined by @ref{stack_size_ao,,@code{dg-add-options} feature
+@code{stack_size}}.
@item static
Target supports @option{-static}.
@code{mips16} function attributes.
Only MIPS targets support this feature, and only then in certain modes.
+@item stack_size
+@anchor{stack_size_ao}
+Add the flags needed to define macro STACK_SIZE and set it to the stack size
+limit associated with the @ref{stack_size_et,,@code{stack_size} effective
+target}.
+
@item tls
Add the target-specific flags needed to use thread-local storage.
@end table
+2017-06-21 Tom de Vries <tom@codesourcery.com>
+
+ * lib/target-supports.exp (add_options_for_stack_size): New proc.
+ * gcc.c-torture/execute/920501-7.c: Use dg-add-options stack_size.
+ * gcc.c-torture/compile/20080806-1.c: Same.
+ * gcc.c-torture/compile/920723-1.c: Same.
+ * gcc.c-torture/compile/930621-1.c: Same.
+ * gcc.c-torture/compile/991214-2.c: Same.
+ * gcc.c-torture/compile/bcopy.c: Same.
+ * gcc.c-torture/compile/memtst.c: Same.
+ * gcc.c-torture/compile/msp.c: Same.
+ * gcc.c-torture/compile/stuct.c: Same.
+ * gcc.c-torture/execute/20011008-3.c: Same.
+ * gcc.c-torture/execute/20030209-1.c: Same.
+ * gcc.c-torture/execute/20031012-1.c: Same.
+ * gcc.c-torture/execute/20040805-1.c: Same.
+ * gcc.c-torture/execute/920410-1.c: Same.
+ * gcc.c-torture/execute/921113-1.c: Same.
+ * gcc.c-torture/execute/921202-1.c: Same.
+ * gcc.c-torture/execute/921208-2.c: Same.
+ * gcc.c-torture/execute/930106-1.c: Same.
+ * gcc.c-torture/execute/930406-1.c: Same.
+ * gcc.c-torture/execute/950221-1.c: Same.
+ * gcc.c-torture/execute/960521-1.c: Same.
+ * gcc.c-torture/execute/980605-1.c: Same.
+ * gcc.c-torture/execute/comp-goto-1.c: Same.
+ * gcc.c-torture/execute/comp-goto-2.c: Same.
+ * gcc.c-torture/execute/memcpy-1.c: Same.
+ * gcc.c-torture/execute/multi-ix.c: Same.
+ * gcc.c-torture/execute/nestfunc-4.c: Same.
+ * gcc.c-torture/execute/pr20621-1.c: Same.
+ * gcc.c-torture/execute/pr23135.c: Same.
+ * gcc.c-torture/execute/pr28982b.c: Same.
+ * gcc.dg/loop-3.c: Same.
+ * gcc.dg/struct-ret-3.c: Same.
+ * gcc.dg/torture/stackalign/comp-goto-1.c: Same.
+ * gcc.dg/torture/stackalign/non-local-goto-4.c: Same.
+ * gcc.dg/tree-prof/comp-goto-1.c: Same.
+ * gcc.dg/tree-prof/pr44777.c: Same.
+
2017-06-20 David Malcolm <dmalcolm@redhat.com>
PR jit/81144
-/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */
+/* { dg-add-options stack_size } */
/* This used to ICE on s390x due to a reload bug. */
-/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */
+/* { dg-add-options stack_size } */
#if defined(STACK_SIZE) && STACK_SIZE < 65536
# define GITT_SIZE 75
-/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */
+/* { dg-add-options stack_size } */
#if defined(STACK_SIZE) && (STACK_SIZE < 65536)
# define BYTEMEM_SIZE 10000L
-/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */
+/* { dg-add-options stack_size } */
#if defined(STACK_SIZE) && (STACK_SIZE < 65536)
# define HISTO_SIZE 9
-/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */
+/* { dg-add-options stack_size } */
void
bcopy1 (s, d, c)
-/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */
+/* { dg-add-options stack_size } */
#ifdef STACK_SIZE
#define SIZE STACK_SIZE / 8
-/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */
+/* { dg-add-options stack_size } */
#ifdef STACK_SIZE
# define A_SIZE (STACK_SIZE/sizeof(int))
-/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */
+/* { dg-add-options stack_size } */
#ifdef STACK_SIZE
#define SIZE STACK_SIZE / 8
-/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */
+/* { dg-add-options stack_size } */
extern void exit (int);
extern void abort (void);
-/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */
+/* { dg-add-options stack_size } */
#ifdef STACK_SIZE
#if STACK_SIZE < 8*100*100
-/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */
+/* { dg-add-options stack_size } */
/* PR optimization/8750
Used to fail under Cygwin with
-/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */
+/* { dg-add-options stack_size } */
#if __INT_MAX__ < 32768 || (defined(STACK_SIZE) && STACK_SIZE < 0x12000)
int main () { exit (0); }
-/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */
+/* { dg-add-options stack_size } */
#define STACK_REQUIREMENT (40000 * 4 + 256)
#if defined (STACK_SIZE) && STACK_SIZE < STACK_REQUIREMENT
/* { dg-require-effective-target label_values } */
/* { dg-require-effective-target trampolines } */
-/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */
+/* { dg-add-options stack_size } */
#ifdef STACK_SIZE
#define DEPTH ((STACK_SIZE) / 512 + 1)
-/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */
+/* { dg-add-options stack_size } */
#define STACK_REQUIREMENT (128 * 128 * 4 + 1024)
#if defined (STACK_SIZE) && STACK_SIZE < STACK_REQUIREMENT
/* { dg-require-effective-target untyped_assembly } */
-/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */
+/* { dg-add-options stack_size } */
#ifndef STACK_SIZE
#define VLEN 2055
/* { dg-require-effective-target untyped_assembly } */
-/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */
+/* { dg-add-options stack_size } */
#define STACK_REQUIREMENT (100000 * 4 + 1024)
#if defined (STACK_SIZE) && STACK_SIZE < STACK_REQUIREMENT
-/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */
+/* { dg-add-options stack_size } */
#if defined (STACK_SIZE)
#define DUMMY_SIZE 9
-/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */
+/* { dg-add-options stack_size } */
f()
{
-/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */
+/* { dg-add-options stack_size } */
struct parsefile
{
-/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */
+/* { dg-add-options stack_size } */
#include <stdlib.h>
-/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */
+/* { dg-add-options stack_size } */
#include <stdio.h>
/* { dg-require-effective-target label_values } */
-/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */
+/* { dg-add-options stack_size } */
#include <stdlib.h>
/* { dg-require-effective-target label_values } */
/* { dg-require-effective-target trampolines } */
-/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */
+/* { dg-add-options stack_size } */
/* A slight variation of 920501-7.c. */
-/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */
+/* { dg-add-options stack_size } */
#include <string.h>
-/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */
+/* { dg-add-options stack_size } */
/* Test for a reload bug:
if you have a memory reference using the indexed addressing
-/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */
+/* { dg-add-options stack_size } */
/* Origin: hp@bitrange.com
Test that return values come out right from a 1000-level call chain to
-/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */
+/* { dg-add-options stack_size } */
/* When generating o32 MIPS PIC, main's $gp save slot was out of range
of a single load instruction. */
-/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */
+/* { dg-add-options stack_size } */
/* Based on execute/simd-1.c, modified by joern.rennecke@st.com to
trigger a reload bug. Verified for gcc mainline from 20050722 13:00 UTC
-/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */
+/* { dg-add-options stack_size } */
/* Like pr28982a.c, but with the spill slots outside the range of
a single sp-based load on ARM. This test tests for cases where
/* { dg-do compile } */
/* { dg-options "-O3" } */
/* { dg-options "-O3 -mtune=i386" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
-/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */
+/* { dg-add-options stack_size } */
#if defined(STACK_SIZE) && (STACK_SIZE < 65536)
# define BYTEMEM_SIZE 10000L
/* Origin: Peeter Joot <peeterj@ca.ibm.com> */
/* { dg-do run { target *-*-linux* *-*-gnu* } } */
-/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */
+/* { dg-add-options stack_size } */
#include <sys/mman.h>
#include <string.h>
/* { dg-do run } */
/* { dg-require-effective-target label_values } */
/* { dg-require-effective-target trampolines } */
-/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */
+/* { dg-add-options stack_size } */
#ifdef STACK_SIZE
#define DEPTH ((STACK_SIZE) / 512 + 1)
/* { dg-require-effective-target nonlocal_goto } */
/* { dg-require-effective-target label_values } */
/* { dg-require-effective-target trampolines } */
-/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */
+/* { dg-add-options stack_size } */
extern void abort (void);
extern void exit (int);
/* { dg-require-effective-target freorder } */
/* { dg-require-effective-target label_values } */
/* { dg-options "-O2 -freorder-blocks-and-partition" } */
-/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */
+/* { dg-add-options stack_size } */
#include <stdlib.h>
/* { dg-require-effective-target label_values } */
/* { dg-require-effective-target trampolines } */
/* { dg-options "-O0" } */
-/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */
+/* { dg-add-options stack_size } */
/* A variant of gcc.c-torture/execute/comp-goto-2.c. */
return $flags
}
+# Add to FLAGS the flags needed to define the STACK_SIZE macro.
+
+proc add_options_for_stack_size { flags } {
+ if [is-effective-target stack_size] {
+ set stack_size [dg-effective-target-value stack_size]
+ return "$flags -DSTACK_SIZE=$stack_size"
+ }
+
+ return $flags
+}
+
# Return 1 if the target provides a full C99 runtime.
proc check_effective_target_c99_runtime { } {