Applied upstream gnulib fix for float test on ppc as well as correction for LDBL_MANT_DIG (bug #733536).
This commit is contained in:
parent
2749439c4f
commit
953cdeac82
2 changed files with 60 additions and 3 deletions
49
diffutils-ppc-float.patch
Normal file
49
diffutils-ppc-float.patch
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
diff -up diffutils-3.2/gnulib-tests/float.c.ppc-float diffutils-3.2/gnulib-tests/float.c
|
||||
--- diffutils-3.2/gnulib-tests/float.c.ppc-float 2011-08-28 12:57:24.000000000 +0100
|
||||
+++ diffutils-3.2/gnulib-tests/float.c 2011-11-25 14:13:58.090442846 +0000
|
||||
@@ -22,7 +22,7 @@
|
||||
/* Specification. */
|
||||
#include <float.h>
|
||||
|
||||
-#if (defined _ARCH_PPC || defined _POWER) && defined _AIX && (LDBL_MANT_DIG == 106) && defined __GNUC__
|
||||
+#if (defined _ARCH_PPC || defined _POWER) && (defined _AIX || defined __linux__) && (LDBL_MANT_DIG == 106) && defined __GNUC__
|
||||
const union gl_long_double_union gl_LDBL_MAX =
|
||||
{ { DBL_MAX, DBL_MAX / (double)134217728UL / (double)134217728UL } };
|
||||
#elif defined __i386__
|
||||
diff -up diffutils-3.2/gnulib-tests/float.in.h.ppc-float diffutils-3.2/gnulib-tests/float.in.h
|
||||
--- diffutils-3.2/gnulib-tests/float.in.h.ppc-float 2011-08-28 12:57:25.000000000 +0100
|
||||
+++ diffutils-3.2/gnulib-tests/float.in.h 2011-11-25 14:13:58.091442827 +0000
|
||||
@@ -111,7 +111,8 @@ extern const union gl_long_double_union
|
||||
#endif
|
||||
|
||||
/* On AIX 7.1 with gcc 4.2, the values of LDBL_MIN_EXP, LDBL_MIN, LDBL_MAX are
|
||||
- wrong. */
|
||||
+ wrong.
|
||||
+ On Linux/PowerPC with gcc 4.4, the value of LDBL_MAX is wrong. */
|
||||
#if (defined _ARCH_PPC || defined _POWER) && defined _AIX && (LDBL_MANT_DIG == 106) && defined __GNUC__
|
||||
# undef LDBL_MIN_EXP
|
||||
# define LDBL_MIN_EXP DBL_MIN_EXP
|
||||
@@ -119,6 +120,8 @@ extern const union gl_long_double_union
|
||||
# define LDBL_MIN_10_EXP DBL_MIN_10_EXP
|
||||
# undef LDBL_MIN
|
||||
# define LDBL_MIN 2.22507385850720138309023271733240406422e-308L /* DBL_MIN = 2^-1022 */
|
||||
+#endif
|
||||
+#if (defined _ARCH_PPC || defined _POWER) && (defined _AIX || defined __linux__) && (LDBL_MANT_DIG == 106) && defined __GNUC__
|
||||
# undef LDBL_MAX
|
||||
/* LDBL_MAX is represented as { 0x7FEFFFFF, 0xFFFFFFFF, 0x7C8FFFFF, 0xFFFFFFFF }.
|
||||
It is not easy to define:
|
||||
diff -up diffutils-3.2/gnulib-tests/test-float.c.ppc-float diffutils-3.2/gnulib-tests/test-float.c
|
||||
--- diffutils-3.2/gnulib-tests/test-float.c.ppc-float 2011-09-01 23:38:42.000000000 +0100
|
||||
+++ diffutils-3.2/gnulib-tests/test-float.c 2011-11-25 14:14:04.623319695 +0000
|
||||
@@ -325,7 +325,11 @@ test_long_double (void)
|
||||
int n;
|
||||
|
||||
ASSERT (m + m > m);
|
||||
+#if (defined _ARCH_PPC || defined _POWER)
|
||||
+ for (n = 0; n <= 2 * DBL_MANT_DIG; n++)
|
||||
+#else
|
||||
for (n = 0; n <= 2 * LDBL_MANT_DIG; n++)
|
||||
+#endif
|
||||
{
|
||||
volatile long double pow2_n = pow2l (n); /* 2^n */
|
||||
volatile long double x = m + (m / pow2_n);
|
||||
Loading…
Add table
Add a link
Reference in a new issue