2017-06-06 Tom de Vries <tom@codesourcery.com>
* doc/sourcebuild.texi (Testsuites, C Language Testsuites,
gcc.c-torture/compile): Remove mention of NO_LABEL_VALUES in fixme.
* gcc.c-torture/compile/
20000326-2.c: Use dg-require-effective-target
label_values instead of NO_LABEL_VALUES.
* gcc.c-torture/compile/920301-1.c: Same.
* gcc.c-torture/compile/920501-1.c: Same.
* gcc.c-torture/compile/941014-4.c: Same.
* gcc.c-torture/compile/labels-1.c: Same.
* gcc.c-torture/compile/pr18903.c: Same.
* gcc.c-torture/execute/920302-1.c: Same.
* gcc.c-torture/execute/920415-1.c: Same.
* gcc.c-torture/execute/920428-2.c: Same.
* gcc.c-torture/execute/920501-3.c: Same.
* gcc.c-torture/execute/920501-4.c: Same.
* gcc.c-torture/execute/920501-5.c: Same.
* gcc.c-torture/execute/920501-7.c: Same.
* gcc.c-torture/execute/920721-4.c: Same.
* gcc.c-torture/execute/980526-1.c: Same.
* gcc.c-torture/execute/990208-1.c: Same.
* gcc.c-torture/execute/comp-goto-1.c: Same.
* gcc.c-torture/execute/comp-goto-2.c: Same.
* gcc.dg/torture/stackalign/comp-goto-1.c: Same.
* gcc.dg/torture/stackalign/non-local-goto-4.c: Same.
* gcc.dg/torture/stackalign/non-local-goto-5.c: Same.
* gcc.dg/tree-prof/comp-goto-1.c: Same.
* gcc.dg/tree-prof/pr44777.c: Same.
* gcc.misc-tests/bprob-2.c: Same.
* gcc.misc-tests/gcov-3.c: Same.
* lib/gcc.exp (gcc_target_compile): Remove appending of
-DNO_LABEL_VALUES to additional_flags.
* lib/objc.exp (objc_target_compile): Same.
* lib/target-supports.exp (check_effective_target_label_values): Test on
'target_info exists gcc,no_label_values' instead of NO_LABEL_VALUES.
From-SVN: r248923
+2017-06-06 Tom de Vries <tom@codesourcery.com>
+
+ * doc/sourcebuild.texi (Testsuites, C Language Testsuites,
+ gcc.c-torture/compile): Remove mention of NO_LABEL_VALUES in fixme.
+
2017-06-06 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* config/aarch64/atomics.md (atomic_compare_and_swap<mode> expander):
While special options can be set, and tests disabled on specific
platforms, by the use of @file{.x} files, mostly these test cases
should not contain platform dependencies. FIXME: discuss how defines
-such as @code{NO_LABEL_VALUES} and @code{STACK_SIZE} are used.
+such as @code{STACK_SIZE} are used.
@item gcc.c-torture/execute
This testsuite contains test cases that should compile, link and run;
otherwise the same comments as for @file{gcc.c-torture/compile} apply.
+2017-06-06 Tom de Vries <tom@codesourcery.com>
+
+ * gcc.c-torture/compile/20000326-2.c: Use dg-require-effective-target
+ label_values instead of NO_LABEL_VALUES.
+ * gcc.c-torture/compile/920301-1.c: Same.
+ * gcc.c-torture/compile/920501-1.c: Same.
+ * gcc.c-torture/compile/941014-4.c: Same.
+ * gcc.c-torture/compile/labels-1.c: Same.
+ * gcc.c-torture/compile/pr18903.c: Same.
+ * gcc.c-torture/execute/920302-1.c: Same.
+ * gcc.c-torture/execute/920415-1.c: Same.
+ * gcc.c-torture/execute/920428-2.c: Same.
+ * gcc.c-torture/execute/920501-3.c: Same.
+ * gcc.c-torture/execute/920501-4.c: Same.
+ * gcc.c-torture/execute/920501-5.c: Same.
+ * gcc.c-torture/execute/920501-7.c: Same.
+ * gcc.c-torture/execute/920721-4.c: Same.
+ * gcc.c-torture/execute/980526-1.c: Same.
+ * gcc.c-torture/execute/990208-1.c: Same.
+ * gcc.c-torture/execute/comp-goto-1.c: Same.
+ * gcc.c-torture/execute/comp-goto-2.c: Same.
+ * gcc.dg/torture/stackalign/comp-goto-1.c: Same.
+ * gcc.dg/torture/stackalign/non-local-goto-4.c: Same.
+ * gcc.dg/torture/stackalign/non-local-goto-5.c: Same.
+ * gcc.dg/tree-prof/comp-goto-1.c: Same.
+ * gcc.dg/tree-prof/pr44777.c: Same.
+ * gcc.misc-tests/bprob-2.c: Same.
+ * gcc.misc-tests/gcov-3.c: Same.
+ * lib/gcc.exp (gcc_target_compile): Remove appending of
+ -DNO_LABEL_VALUES to additional_flags.
+ * lib/objc.exp (objc_target_compile): Same.
+ * lib/target-supports.exp (check_effective_target_label_values): Test on
+ 'target_info exists gcc,no_label_values' instead of NO_LABEL_VALUES.
+
2017-06-06 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* gcc.target/aarch64/atomic_cmp_exchange_zero_reg_1.c: New test.
-#ifndef NO_LABEL_VALUES
+/* { dg-require-effective-target label_values } */
+
extern int printk(const char *fmt, ...);
void foo (int x, int y)
here:
printk ("", &&here);
}
-
-#else
-int x;
-#endif
-#ifndef NO_LABEL_VALUES
+/* { dg-require-effective-target label_values } */
+
f(){static void*t[]={&&x};x:;}
-#endif
g(){static unsigned p[5];}
-#ifndef NO_LABEL_VALUES
+/* { dg-require-effective-target label_values } */
+
a(){int**b[]={&&c};c:;}
-#else
-int x;
-#endif
-#ifndef NO_LABEL_VALUES
+/* { dg-require-effective-target label_values } */
+
f (int *re)
{
int *loops = 0, *loope = 0;
if (dat0 & 1)
re[(dat0 >> 2) & 3] = 0;
}
-#else
-int x;
-#endif
-#ifndef NO_LABEL_VALUES
+/* { dg-require-effective-target label_values } */
+
f ()
{
void *x = &&L2;
L2: abort ();
L3:;
}
-#else
-int x;
-#endif
+/* { dg-require-effective-target label_values } */
+
/* We were ICEing in bsi_after_labels because
we had a BB which did not have a lablel.
PR middle-end/18903 */
-#ifndef NO_LABEL_VALUES
void g (int s, int f)
{
&&ff;
f = s;
end:;
}
-#else
-int g;
-#endif
+/* { dg-require-effective-target label_values } */
+
short optab[5];
char buf[10];
execute (ip)
register short *ip;
{
-#ifndef NO_LABEL_VALUES
register void *base = &&x;
char *bp = buf;
static void *tab[] = {&&x, &&y, &&z};
z: *bp++='z';
*bp=0;
return;
-#else
- strcpy (buf, "xyxyz");
-#endif
}
short p[5];
-#ifndef NO_LABEL_VALUES
+/* { dg-require-effective-target label_values } */
main(){__label__ l;void*x(){return&&l;}goto*x();abort();return;l:exit(0);}
-#else
-main(){ exit (0); }
-#endif
-#if !defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES)
+/* { dg-require-effective-target label_values } */
+
+#if !defined (NO_TRAMPOLINES)
s(i){if(i>0){__label__ l1;int f(int i){if(i==2)goto l1;return 0;}return f(i);l1:;}return 1;}
x(){return s(0)==1&&s(1)==0&&s(2)==1;}
main(){if(x()!=1)abort();exit(0);}
+/* { dg-require-effective-target label_values } */
+
int tab[9];
execute(oip, ip)
unsigned short *oip, *ip;
{
-#ifndef NO_LABEL_VALUES
int x = 0;
int *xp = tab;
base:
}
*xp++ = ip - oip;
goto *(&&base + *ip++);
-#else
- tab[0] = 0;
- tab[1] = 1;
- tab[2] = 2;
- tab[3] = 0;
-#endif
}
main()
-#ifndef NO_LABEL_VALUES
+/* { dg-require-effective-target label_values } */
+
int
x (int i)
{
exit (0);
}
-#else
-int
-main (void) { exit (0); }
-#endif
-#ifndef NO_LABEL_VALUES
+/* { dg-require-effective-target label_values } */
+
x (int i)
{
void *j[] = {&&x, &&y, &&z};
abort();
exit(0);
}
-#else
-main(){ exit (0); }
-#endif
+/* { dg-require-effective-target label_values } */
+
#ifdef STACK_SIZE
#define DEPTH ((STACK_SIZE) / 512 + 1)
#else
#define DEPTH 1000
#endif
-#if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES)
+#if !defined (NO_TRAMPOLINES)
x(a)
{
__label__ xlab;
main ()
{
-#if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES)
+#if !defined (NO_TRAMPOLINES)
if (x (DEPTH) != DEPTH)
abort ();
#endif
-#ifndef NO_LABEL_VALUES
+/* { dg-require-effective-target label_values } */
+
int try (int num) {
__label__ lab1, lab2, lab3, lab4, lab5, lab6, default_lab;
}
exit(0);
}
-#else
-main(){ exit (0); }
-#endif
-/* { dg-skip-if "requires indirect jumps" { ! indirect_jumps } { "-O0" } { "" } } */
-/* { dg-skip-if "requires label values" { ! label_values } { "-O0" } { "" } } */
+/* { dg-require-effective-target label_values } */
+
int expect_do1 = 1, expect_do2 = 2;
static int doit(int x){
}
int main(void){
-#ifndef NO_LABEL_VALUES
- do1();
- do2();
-#endif
exit(0);
}
+/* { dg-require-effective-target label_values } */
+
/* As a quality of implementation issue, we should not prevent inlining
of function explicitly marked inline just because a label therein had
its address taken. */
-#ifndef NO_LABEL_VALUES
static void *ptr1, *ptr2;
static int i = 1;
}
void bar(void) { }
-
-#else /* NO_LABEL_VALUES */
-int main() { exit(0); }
-#endif
+/* { dg-require-effective-target label_values } */
+
#include <stdlib.h>
-#if !defined(NO_LABEL_VALUES) && (!defined(STACK_SIZE) || STACK_SIZE >= 4000) && __INT_MAX__ >= 2147483647
+#if (!defined(STACK_SIZE) || STACK_SIZE >= 4000) && __INT_MAX__ >= 2147483647
typedef unsigned int uint32;
typedef signed int sint32;
+/* { dg-require-effective-target label_values } */
+
/* A slight variation of 920501-7.c. */
#ifdef STACK_SIZE
#define DEPTH 1000
#endif
-#if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES)
+#if !defined (NO_TRAMPOLINES)
x(a)
{
__label__ xlab;
main ()
{
-#if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES)
+#if !defined (NO_TRAMPOLINES)
if (x (DEPTH) != DEPTH)
abort ();
#endif
/* { dg-do run } */
+/* { dg-require-effective-target label_values } */
#ifdef STACK_SIZE
#define DEPTH ((STACK_SIZE) / 512 + 1)
extern void abort (void);
extern void exit (int);
-#if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES)
+#if !defined (NO_TRAMPOLINES)
int
x(int a)
{
int
main ()
{
-#if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES)
+#if !defined (NO_TRAMPOLINES)
if (x (DEPTH) != DEPTH)
abort ();
#endif
/* { dg-do run } */
/* { dg-require-effective-target nonlocal_goto } */
+/* { dg-require-effective-target label_values } */
extern void abort (void);
extern void exit (int);
#define DEPTH 1000
#endif
-#if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES)
+#if !defined (NO_TRAMPOLINES)
int
x(int a)
{
int
main ()
{
-#if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES)
+#if !defined (NO_TRAMPOLINES)
if (x (DEPTH) != DEPTH)
abort ();
#endif
/* { dg-do run } */
/* { dg-require-effective-target nonlocal_goto } */
+/* { dg-require-effective-target label_values } */
extern void exit (int);
-#if !defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES)
+#if !defined (NO_TRAMPOLINES)
extern void abort (void);
int s(int i){if(i>0){__label__ l1;int f(int i){if(i==2)goto l1;return 0;}return f(i);l1:;}return 1;}
int x(){return s(0)==1&&s(1)==0&&s(2)==1;}
/* { dg-require-effective-target freorder } */
+/* { dg-require-effective-target label_values } */
/* { dg-options "-O2 -freorder-blocks-and-partition" } */
#include <stdlib.h>
-#if !defined(NO_LABEL_VALUES) && (!defined(STACK_SIZE) || STACK_SIZE >= 4000) && __INT_MAX__ >= 2147483647
+#if (!defined(STACK_SIZE) || STACK_SIZE >= 4000) && __INT_MAX__ >= 2147483647
typedef unsigned int uint32;
typedef signed int sint32;
/* PR middle-end/44777 */
+/* { dg-require-effective-target label_values } */
/* { dg-options "-O0" } */
/* A variant of gcc.c-torture/execute/comp-goto-2.c. */
#define DEPTH 1000
#endif
-#if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES)
+#if !defined (NO_TRAMPOLINES)
int
x (int a)
{
int
main ()
{
-#if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES)
+#if !defined (NO_TRAMPOLINES)
if (x (DEPTH) != DEPTH)
abort ();
#endif
+/* { dg-require-effective-target label_values } */
+
/* Test profile-directed block ordering with computed gotos.
*
This is the same as test gcc.c-torture/execute/980526-1.c and
}
int main(void){
-#ifndef NO_LABEL_VALUES
do1();
do2();
-#endif
exit(0);
}
+/* { dg-require-effective-target label_values } */
+
/* Test Gcov with computed gotos.
This is the same as test gcc.c-torture/execute/980526-1.c */
}
int main(void){ /* count(1) */
-#ifndef NO_LABEL_VALUES
do1();
do2();
-#endif
exit(0); /* count(1) */
}
if [target_info exists gcc,no_trampolines] {
lappend options "additional_flags=-DNO_TRAMPOLINES"
}
- if [target_info exists gcc,no_label_values] {
- lappend options "additional_flags=-DNO_LABEL_VALUES"
- }
if [target_info exists gcc,signal_suppress] {
lappend options "additional_flags=-DSIGNAL_SUPPRESS"
}
if [target_info exists objc,no_trampolines] {
lappend options "additional_flags=-DNO_TRAMPOLINES"
}
- if [target_info exists objc,no_label_values] {
- lappend options "additional_flags=-DNO_LABEL_VALUES"
- }
# TEST_ALWAYS_FLAGS are flags that should be passed to every
# compilation. They are passed first to allow individual
# Return 1 if taking label values is supported, 0 otherwise.
proc check_effective_target_label_values {} {
- if { [istarget nvptx-*-*] } {
+ if { [istarget nvptx-*-*] || [target_info exists gcc,no_label_values] } {
return 0
}
- return [check_no_compiler_messages label_values assembly {
- #ifdef NO_LABEL_VALUES
- #error NO
- #endif
- }]
+
+ return 1
}
# Return 1 if builtin_return_address and builtin_frame_address are