From 8d1a718e0685688e763d768d357e8ed84db22d30 Mon Sep 17 00:00:00 2001 From: Georg-Johann Lay Date: Fri, 18 Oct 2019 06:46:03 +0000 Subject: [PATCH] Fix some fallout for small targets. gcc/testsuite/ Fix some fallout for small targets. PR testsuite/52641 * gcc.c-torture/execute/20190820-1.c: Add dg-require-effective-target int32plus. * gcc.c-torture/execute/pr85331.c Add dg-require-effective-target double64plus. * gcc.dg/pow-sqrt-1.c: Same. * gcc.dg/pow-sqrt-2.c: Same. * gcc.dg/pow-sqrt-3.c: Same. * gcc.c-torture/execute/20190901-1.c: Same. * gcc.c-torture/execute/user-printf.c [avr]: Skip. * gcc.c-torture/execute/fprintf-2.c [avr]: Skip. * gcc.c-torture/execute/printf-2.c [avr]: Skip. * gcc.dg/Wlarger-than3.c [avr]: Skip. * gcc.c-torture/execute/ieee/20041213-1.c (sqrt) [avr,double=float]: Provide custom prototype. * gcc.dg/pr36017.c: Same. * gcc.c-torture/execute/pr90025.c: Use 32-bit int. * gcc.dg/complex-7.c: Add dg-require-effective-target double64. * gcc.dg/loop-versioning-1.c: Add dg-require-effective-target size32plus. * gcc.dg/loop-versioning-2.c: Same. From-SVN: r277142 --- gcc/testsuite/ChangeLog | 26 +++++++++++++++++++ .../gcc.c-torture/execute/20190820-1.c | 1 + .../gcc.c-torture/execute/20190901-1.c | 5 ++++ .../gcc.c-torture/execute/fprintf-2.c | 1 + .../gcc.c-torture/execute/ieee/20041213-1.c | 4 +++ gcc/testsuite/gcc.c-torture/execute/pr85331.c | 1 + gcc/testsuite/gcc.c-torture/execute/pr90025.c | 4 +-- .../gcc.c-torture/execute/printf-2.c | 1 + .../gcc.c-torture/execute/user-printf.c | 1 + gcc/testsuite/gcc.dg/Wlarger-than3.c | 2 +- gcc/testsuite/gcc.dg/complex-7.c | 1 + gcc/testsuite/gcc.dg/loop-versioning-1.c | 1 + gcc/testsuite/gcc.dg/loop-versioning-2.c | 1 + gcc/testsuite/gcc.dg/pow-sqrt-1.c | 1 + gcc/testsuite/gcc.dg/pow-sqrt-2.c | 1 + gcc/testsuite/gcc.dg/pow-sqrt-3.c | 1 + gcc/testsuite/gcc.dg/pr36017.c | 4 +++ 17 files changed, 53 insertions(+), 3 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index fc634579468..b783c8dede3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,29 @@ +2019-10-18 Georg-Johann Lay + + Fix some fallout for small targets. + + PR testsuite/52641 + * gcc.c-torture/execute/20190820-1.c: + Add dg-require-effective-target int32plus. + * gcc.c-torture/execute/pr85331.c + Add dg-require-effective-target double64plus. + * gcc.dg/pow-sqrt-1.c: Same. + * gcc.dg/pow-sqrt-2.c: Same. + * gcc.dg/pow-sqrt-3.c: Same. + * gcc.c-torture/execute/20190901-1.c: Same. + * gcc.c-torture/execute/user-printf.c [avr]: Skip. + * gcc.c-torture/execute/fprintf-2.c [avr]: Skip. + * gcc.c-torture/execute/printf-2.c [avr]: Skip. + * gcc.dg/Wlarger-than3.c [avr]: Skip. + * gcc.c-torture/execute/ieee/20041213-1.c (sqrt) + [avr,double=float]: Provide custom prototype. + * gcc.dg/pr36017.c: Same. + * gcc.c-torture/execute/pr90025.c: Use 32-bit int. + * gcc.dg/complex-7.c: Add dg-require-effective-target double64. + * gcc.dg/loop-versioning-1.c: + Add dg-require-effective-target size32plus. + * gcc.dg/loop-versioning-2.c: Same. + 2019-10-18 Prathamesh Kulkarni Richard Sandiford diff --git a/gcc/testsuite/gcc.c-torture/execute/20190820-1.c b/gcc/testsuite/gcc.c-torture/execute/20190820-1.c index 6a06eff7571..10e48d35750 100644 --- a/gcc/testsuite/gcc.c-torture/execute/20190820-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/20190820-1.c @@ -1,5 +1,6 @@ /* PR rtl-optimization/91347 */ /* Reported by John David Anglin */ +/* { dg-require-effective-target int32plus } */ typedef unsigned short __u16; typedef __signed__ int __s32; diff --git a/gcc/testsuite/gcc.c-torture/execute/20190901-1.c b/gcc/testsuite/gcc.c-torture/execute/20190901-1.c index c78715ef2c1..2345e51896f 100644 --- a/gcc/testsuite/gcc.c-torture/execute/20190901-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/20190901-1.c @@ -1,7 +1,12 @@ /* PR target/91472 */ /* Reported by John Paul Adrian Glaubitz */ +/* { dg-require-effective-target double64plus } */ +#if __SIZEOF_INT__ >= 4 typedef unsigned int gmp_uint_least32_t; +#else +typedef __UINT_LEAST32_TYPE__ gmp_uint_least32_t; +#endif union ieee_double_extract { diff --git a/gcc/testsuite/gcc.c-torture/execute/fprintf-2.c b/gcc/testsuite/gcc.c-torture/execute/fprintf-2.c index bba4a446ee9..7280b9b5e3c 100644 --- a/gcc/testsuite/gcc.c-torture/execute/fprintf-2.c +++ b/gcc/testsuite/gcc.c-torture/execute/fprintf-2.c @@ -1,6 +1,7 @@ /* Verify that calls to fprintf don't get eliminated even if their result on success can be computed at compile time (they can fail). The calls can still be transformed into those of other functions. + { dg-skip-if "requires io" { avr-*-* } } { dg-skip-if "requires io" { freestanding } } */ #include diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/20041213-1.c b/gcc/testsuite/gcc.c-torture/execute/ieee/20041213-1.c index 07bdf6860d4..6830359e1f9 100644 --- a/gcc/testsuite/gcc.c-torture/execute/ieee/20041213-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/ieee/20041213-1.c @@ -1,4 +1,8 @@ +#if defined (__AVR__) && (__SIZEOF_DOUBLE__ == __SIZEOF_FLOAT__) +extern double sqrt (double) __asm ("sqrtf"); +#else extern double sqrt (double); +#endif extern void abort (void); int once; diff --git a/gcc/testsuite/gcc.c-torture/execute/pr85331.c b/gcc/testsuite/gcc.c-torture/execute/pr85331.c index 3ef805a289e..e0c426f81da 100644 --- a/gcc/testsuite/gcc.c-torture/execute/pr85331.c +++ b/gcc/testsuite/gcc.c-torture/execute/pr85331.c @@ -1,4 +1,5 @@ /* PR tree-optimization/85331 */ +/* { dg-require-effective-target double64plus } */ typedef double V __attribute__((vector_size (2 * sizeof (double)))); typedef long long W __attribute__((vector_size (2 * sizeof (long long)))); diff --git a/gcc/testsuite/gcc.c-torture/execute/pr90025.c b/gcc/testsuite/gcc.c-torture/execute/pr90025.c index a1ddd0027d6..052d97c7fc2 100644 --- a/gcc/testsuite/gcc.c-torture/execute/pr90025.c +++ b/gcc/testsuite/gcc.c-torture/execute/pr90025.c @@ -13,10 +13,10 @@ bar (char *p) } __attribute__((noipa)) void -foo (unsigned int x) +foo (__UINT32_TYPE__ x) { char s[32] = { 'f', 'o', 'o', 'b', 'a', 'r', 0 }; - ((unsigned int *) s)[2] = __builtin_bswap32 (x); + ((__UINT32_TYPE__ *) s)[2] = __builtin_bswap32 (x); bar (s); } diff --git a/gcc/testsuite/gcc.c-torture/execute/printf-2.c b/gcc/testsuite/gcc.c-torture/execute/printf-2.c index 2e9f2a2bb75..c2d729a665c 100644 --- a/gcc/testsuite/gcc.c-torture/execute/printf-2.c +++ b/gcc/testsuite/gcc.c-torture/execute/printf-2.c @@ -2,6 +2,7 @@ result on success can be computed at compile time (they can fail). The calls can still be transformed into those of other functions. { dg-require-effective-target unwrapped } + { dg-skip-if "requires io" { avr-*-* } } { dg-skip-if "requires io" { freestanding } } */ #include diff --git a/gcc/testsuite/gcc.c-torture/execute/user-printf.c b/gcc/testsuite/gcc.c-torture/execute/user-printf.c index 11c61fa3949..0f81bec60b7 100644 --- a/gcc/testsuite/gcc.c-torture/execute/user-printf.c +++ b/gcc/testsuite/gcc.c-torture/execute/user-printf.c @@ -2,6 +2,7 @@ don't get eliminated even if their result on success can be computed at compile time (they can fail). { dg-require-effective-target unwrapped } + { dg-skip-if "requires io" { avr-*-* } } { dg-skip-if "requires io" { freestanding } } */ #include diff --git a/gcc/testsuite/gcc.dg/Wlarger-than3.c b/gcc/testsuite/gcc.dg/Wlarger-than3.c index ebac525ed62..17af07b72e2 100644 --- a/gcc/testsuite/gcc.dg/Wlarger-than3.c +++ b/gcc/testsuite/gcc.dg/Wlarger-than3.c @@ -1,6 +1,6 @@ /* Exercise -Wlarger-than= with a byte-size suffix. { dg-do compile } - { dg-skip-if "small address space" { "pdp11-*-*" } } + { dg-skip-if "small address space" { "pdp11-*-*" } { "avr-*-*" } } { dg-options "-Wlarger-than=1MiB" } */ #define MB (1000 * 1000) /* MegaByte */ diff --git a/gcc/testsuite/gcc.dg/complex-7.c b/gcc/testsuite/gcc.dg/complex-7.c index 78f1a290e34..a1f136ce9a2 100644 --- a/gcc/testsuite/gcc.dg/complex-7.c +++ b/gcc/testsuite/gcc.dg/complex-7.c @@ -2,6 +2,7 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fdump-tree-cplxlower" } */ +/* { dg-require-effective-target double64 } */ __complex double foo (__complex double a, __complex double b) diff --git a/gcc/testsuite/gcc.dg/loop-versioning-1.c b/gcc/testsuite/gcc.dg/loop-versioning-1.c index e61ff7a5d10..17e95fdfbab 100644 --- a/gcc/testsuite/gcc.dg/loop-versioning-1.c +++ b/gcc/testsuite/gcc.dg/loop-versioning-1.c @@ -1,4 +1,5 @@ /* { dg-options "-O3 -fdump-tree-lversion-details" } */ +/* { dg-require-effective-target size32plus } */ /* The simplest IV case. */ diff --git a/gcc/testsuite/gcc.dg/loop-versioning-2.c b/gcc/testsuite/gcc.dg/loop-versioning-2.c index 9416b540614..3d07f83d205 100644 --- a/gcc/testsuite/gcc.dg/loop-versioning-2.c +++ b/gcc/testsuite/gcc.dg/loop-versioning-2.c @@ -1,4 +1,5 @@ /* { dg-options "-O3 -fdump-tree-lversion-details" } */ +/* { dg-require-effective-target size32plus } */ /* Versioning for step == 1 in these loops would allow loop interchange, but otherwise isn't worthwhile. At the moment we decide not to version. */ diff --git a/gcc/testsuite/gcc.dg/pow-sqrt-1.c b/gcc/testsuite/gcc.dg/pow-sqrt-1.c index 0793b6f9eaf..17003c5d71c 100644 --- a/gcc/testsuite/gcc.dg/pow-sqrt-1.c +++ b/gcc/testsuite/gcc.dg/pow-sqrt-1.c @@ -1,5 +1,6 @@ /* { dg-do run } */ /* { dg-options "-O2 -ffast-math --param max-pow-sqrt-depth=5" } */ +/* { dg-require-effective-target double64plus } */ #define EXPN (-6 * (0.5*0.5*0.5*0.5)) diff --git a/gcc/testsuite/gcc.dg/pow-sqrt-2.c b/gcc/testsuite/gcc.dg/pow-sqrt-2.c index b2fada49e85..96d7ce9c8cf 100644 --- a/gcc/testsuite/gcc.dg/pow-sqrt-2.c +++ b/gcc/testsuite/gcc.dg/pow-sqrt-2.c @@ -1,5 +1,6 @@ /* { dg-do run } */ /* { dg-options "-O2 -ffast-math --param max-pow-sqrt-depth=5" } */ +/* { dg-require-effective-target double64plus } */ #define EXPN (-5.875) #include "pow-sqrt.x" diff --git a/gcc/testsuite/gcc.dg/pow-sqrt-3.c b/gcc/testsuite/gcc.dg/pow-sqrt-3.c index 18c7231a5bb..c166586ac63 100644 --- a/gcc/testsuite/gcc.dg/pow-sqrt-3.c +++ b/gcc/testsuite/gcc.dg/pow-sqrt-3.c @@ -1,5 +1,6 @@ /* { dg-do run } */ /* { dg-options "-O2 -ffast-math --param max-pow-sqrt-depth=3" } */ +/* { dg-require-effective-target double64plus } */ #define EXPN (1.25) #include "pow-sqrt.x" diff --git a/gcc/testsuite/gcc.dg/pr36017.c b/gcc/testsuite/gcc.dg/pr36017.c index 2af71e6006e..d18c97ddfad 100644 --- a/gcc/testsuite/gcc.dg/pr36017.c +++ b/gcc/testsuite/gcc.dg/pr36017.c @@ -2,7 +2,11 @@ /* { dg-do run } */ /* { dg-options "-O2" } */ +#if defined (__AVR__) && (__SIZEOF_DOUBLE__ == __SIZEOF_FLOAT__) +extern double sqrt (double) __asm ("sqrtf"); +#else extern double sqrt (double); +#endif extern void abort (void); __attribute__((noinline)) double -- 2.30.2