PowerPC: require IBM long double for pr70117. Since the test is explicitly checking for IBM extended double, do not try to run it when long double is IEEE 128-bit.
I have tested this patch and the first patch in the series on a little endian power9 system with 3 compilers that have the 3 different long double types configured. I verified that this test is listed as unsupported if long double is not IBM 128-bit, and it passes if long double is IBM 128-bit. Can I check this patch into the master branch? After an appropriate soak-in time, can I back port this patch to the previous open GCC trees? gcc/testsuite/ 2020-11-21 Michael Meissner <meiss...@linux.ibm.com> PR target/70117 * gcc.target/powerpc/pr70117.c: Only run the test if long double uses the IBM extended double format. --- gcc/testsuite/gcc.target/powerpc/pr70117.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/gcc/testsuite/gcc.target/powerpc/pr70117.c b/gcc/testsuite/gcc.target/powerpc/pr70117.c index 3bbd2c595e0..2077d15afd4 100644 --- a/gcc/testsuite/gcc.target/powerpc/pr70117.c +++ b/gcc/testsuite/gcc.target/powerpc/pr70117.c @@ -1,26 +1,12 @@ -/* { dg-do run { target { powerpc*-*-linux* powerpc*-*-darwin* powerpc*-*-aix* rs6000-*-* } } } */ -/* { dg-options "-std=c99 -mlong-double-128 -O2" } */ +/* { dg-require-effective-target ppc_long_double_ibm } */ +/* { dg-options "-std=c99 -O2" } */ #include <float.h> -#if defined(__LONG_DOUBLE_IEEE128__) -/* If long double is IEEE 128-bit, we need to use the __ibm128 type instead of - long double. We can't use __ibm128 on systems that don't support IEEE - 128-bit floating point, because the type is not enabled on those - systems. */ -#define LDOUBLE __ibm128 - -#elif defined(__LONG_DOUBLE_IBM128__) -#define LDOUBLE long double - -#else -#error "long double must be either IBM 128-bit or IEEE 128-bit" -#endif - union gl_long_double_union { struct { double hi; double lo; } dd; - LDOUBLE ld; + long double ld; }; /* This is gnulib's LDBL_MAX which, being 107 bits in precision, is @@ -36,7 +22,7 @@ volatile double dnan = 0.0/0.0; int main (void) { - LDOUBLE ld; + long double ld; ld = gl_LDBL_MAX.ld; if (__builtin_isinf (ld)) -- 2.22.0 -- Michael Meissner, IBM IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA email: meiss...@linux.ibm.com, phone: +1 (978) 899-4797