This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Testing 2.16 release candidate with gnulib
- From: Bruno Haible <bruno at clisp dot org>
- To: Carlos O'Donell <carlos_odonell at mentor dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Sat, 30 Jun 2012 00:33:26 +0200
- Subject: Re: Testing 2.16 release candidate with gnulib
- Bcc: bruno at haible dot de
- References: <4FEBDA04.6010709@mentor.com> <2058186.PDnk2TcgS3@linuix> <4FEDC3FB.6050501@mentor.com>
[Carlos sent me the configuration results of testing a gnulib testdir
with a glibc 2.16 release candidate on x86_64.]
Hi Carlos,
The unexpected replacements/workarounds are the following:
* fma.o
This is due to
checking whether fma works... no
The test program exited with status 108 = 4 | 8 | 32 | 64
which means that the following test program will show them:
===============================================================================
#include <float.h>
#include <math.h>
double p0 = 0.0;
int main()
{
int failed_tests = 0;
{
volatile double x = 1.0 + ldexp (1.0, 1 - DBL_MANT_DIG); /* 2^0 + 2^-52 */
volatile double y = x;
volatile double z = 4.0; /* 2^2 */
/* x * y + z with infinite precision: 2^2 + 2^0 + 2^-51 + 2^-104.
Lies between (2^52 + 2^50) * 2^-50 and (2^52 + 2^50 + 1) * 2^-50
and is closer to (2^52 + 2^50 + 1) * 2^-50, therefore the rounding
must round up and produce (2^52 + 2^50 + 1) * 2^-50. */
volatile double expected = 4.0 + 1.0 + ldexp (1.0, 3 - DBL_MANT_DIG);
volatile double result = fma (x, y, z);
if (result != expected)
failed_tests |= 4;
}
{
volatile double x = 1.0 + ldexp (1.0, 1 - DBL_MANT_DIG); /* 2^0 + 2^-52 */
volatile double y = - x;
volatile double z = 8.0; /* 2^3 */
/* x * y + z with infinite precision: 2^2 + 2^1 + 2^0 - 2^-51 - 2^-104.
Lies between (2^52 + 2^51 + 2^50 - 1) * 2^-50 and
(2^52 + 2^51 + 2^50) * 2^-50 and is closer to
(2^52 + 2^51 + 2^50 - 1) * 2^-50, therefore the rounding
must round down and produce (2^52 + 2^51 + 2^50 - 1) * 2^-50. */
volatile double expected = 7.0 - ldexp (1.0, 3 - DBL_MANT_DIG);
volatile double result = fma (x, y, z);
if (result != expected)
failed_tests |= 8;
}
if ((DBL_MANT_DIG % 2) == 1)
{
volatile double x = 1.0 + ldexp (1.0, - (DBL_MANT_DIG + 1) / 2); /* 2^0 + 2^-27 */
volatile double y = 1.0 - ldexp (1.0, - (DBL_MANT_DIG + 1) / 2); /* 2^0 - 2^-27 */
volatile double z = - ldexp (1.0, DBL_MIN_EXP - DBL_MANT_DIG); /* - 2^-1074 */
/* x * y + z with infinite precision: 2^0 - 2^-54 - 2^-1074.
Lies between (2^53 - 1) * 2^-53 and 2^53 * 2^-53 and is closer to
(2^53 - 1) * 2^-53, therefore the rounding must round down and
produce (2^53 - 1) * 2^-53. */
volatile double expected = 1.0 - ldexp (1.0, - DBL_MANT_DIG);
volatile double result = fma (x, y, z);
if (result != expected)
failed_tests |= 32;
}
{
double minus_inf = -1.0 / p0;
volatile double x = ldexp (1.0, DBL_MAX_EXP - 1);
volatile double y = ldexp (1.0, DBL_MAX_EXP - 1);
volatile double z = minus_inf;
volatile double result = fma (x, y, z);
if (!(result == minus_inf))
failed_tests |= 64;
}
return failed_tests;
}
===============================================================================
* fmaf.o
This is due to
checking whether fmaf works... no
The test program exited with status 108 = 4 | 8 | 32 | 64
which means that the following test program will show them:
===============================================================================
#include <float.h>
#include <math.h>
float p0 = 0.0f;
int main()
{
int failed_tests = 0;
{
volatile float x = 1.0f + ldexpf (1.0f, 1 - FLT_MANT_DIG); /* 2^0 + 2^-23 */
volatile float y = x;
volatile float z = 4.0f; /* 2^2 */
/* x * y + z with infinite precision: 2^2 + 2^0 + 2^-22 + 2^-46.
Lies between (2^23 + 2^21) * 2^-21 and (2^23 + 2^21 + 1) * 2^-21
and is closer to (2^23 + 2^21 + 1) * 2^-21, therefore the rounding
must round up and produce (2^23 + 2^21 + 1) * 2^-21. */
volatile float expected = 4.0f + 1.0f + ldexpf (1.0f, 3 - FLT_MANT_DIG);
volatile float result = fmaf (x, y, z);
if (result != expected)
failed_tests |= 4;
}
{
volatile float x = 1.0f + ldexpf (1.0f, 1 - FLT_MANT_DIG); /* 2^0 + 2^-23 */
volatile float y = - x;
volatile float z = 8.0f; /* 2^3 */
/* x * y + z with infinite precision: 2^2 + 2^1 + 2^0 - 2^-22 - 2^-46.
Lies between (2^23 + 2^22 + 2^21 - 1) * 2^-21 and
(2^23 + 2^22 + 2^21) * 2^-21 and is closer to
(2^23 + 2^22 + 2^21 - 1) * 2^-21, therefore the rounding
must round down and produce (2^23 + 2^22 + 2^21 - 1) * 2^-21. */
volatile float expected = 7.0f - ldexpf (1.0f, 3 - FLT_MANT_DIG);
volatile float result = fmaf (x, y, z);
if (result != expected)
failed_tests |= 8;
}
if ((FLT_MANT_DIG % 2) == 0)
{
volatile float x = 1.0f + ldexpf (1.0f, - FLT_MANT_DIG / 2); /* 2^0 + 2^-12 */
volatile float y = x;
volatile float z = ldexpf (1.0f, FLT_MIN_EXP - FLT_MANT_DIG); /* 2^-149 */
/* x * y + z with infinite precision: 2^0 + 2^-11 + 2^-24 + 2^-149.
Lies between (2^23 + 2^12 + 0) * 2^-23 and (2^23 + 2^12 + 1) * 2^-23
and is closer to (2^23 + 2^12 + 1) * 2^-23, therefore the rounding
must round up and produce (2^23 + 2^12 + 1) * 2^-23. */
volatile float expected =
1.0f + ldexpf (1.0f, 1 - FLT_MANT_DIG / 2) + ldexpf (1.0f, 1 - FLT_MANT_DIG);
volatile float result = fmaf (x, y, z);
if (result != expected)
failed_tests |= 32;
}
{
float minus_inf = -1.0f / p0;
volatile float x = ldexpf (1.0f, FLT_MAX_EXP - 1);
volatile float y = ldexpf (1.0f, FLT_MAX_EXP - 1);
volatile float z = minus_inf;
volatile float result = fmaf (x, y, z);
if (!(result == minus_inf))
failed_tests |= 64;
}
return failed_tests;
}
===============================================================================
* fmal.o
This is due to
checking whether fmal works... no
The test program exited with status 58 = 2 | 8 | 16 | 32
which means that the following test program will show them:
===============================================================================
#include <float.h>
#include <math.h>
long double p0 = 0.0L;
int main()
{
int failed_tests = 0;
/* This test fails on glibc 2.11 x86,x86_64,powerpc, glibc 2.7 hppa,sparc,
OSF/1 5.1, mingw. */
{
volatile long double x = 1.0L + ldexpl (1.0L, 1 - LDBL_MANT_DIG); /* 2^0 + 2^-63 */
volatile long double y = x;
volatile long double z = 4.0L; /* 2^2 */
/* x * y + z with infinite precision: 2^2 + 2^0 + 2^-62 + 2^-126.
Lies between (2^63 + 2^61) * 2^-61 and (2^63 + 2^61 + 1) * 2^-61
and is closer to (2^63 + 2^61 + 1) * 2^-61, therefore the rounding
must round up and produce (2^63 + 2^61 + 1) * 2^-61. */
volatile long double expected = 4.0L + 1.0L + ldexpl (1.0L, 3 - LDBL_MANT_DIG);
volatile long double result = fmal (x, y, z);
if (result != expected)
failed_tests |= 2;
}
/* This test fails on glibc 2.11 x86,x86_64,powerpc glibc 2.7 hppa,sparc,
OSF/1 5.1, mingw. */
{
volatile long double x = 1.0L + ldexpl (1.0L, 1 - LDBL_MANT_DIG); /* 2^0 + 2^-63 */
volatile long double y = - x;
volatile long double z = 8.0L; /* 2^3 */
/* x * y + z with infinite precision: 2^2 + 2^1 + 2^0 - 2^-62 - 2^-126.
Lies between (2^63 + 2^62 + 2^61 - 1) * 2^-61 and
(2^63 + 2^62 + 2^61) * 2^-61 and is closer to
(2^63 + 2^62 + 2^61 - 1) * 2^-61, therefore the rounding
must round down and produce (2^63 + 2^62 + 2^61 - 1) * 2^-61. */
volatile long double expected = 7.0L - ldexpl (1.0L, 3 - LDBL_MANT_DIG);
volatile long double result = fmal (x, y, z);
if (result != expected)
failed_tests |= 2;
}
/* These tests fail on glibc 2.11 x86,x86_64,powerpc, mingw. */
{
volatile long double x = 1.0L + ldexpl (1.0L, - LDBL_MANT_DIG / 2); /* 2^0 + 2^-32 */
volatile long double y = x;
volatile long double z = ldexpl (1.0L, LDBL_MIN_EXP - LDBL_MANT_DIG); /* 2^-16445 */
/* x * y + z with infinite precision: 2^0 + 2^-31 + 2^-64 + 2^-16445.
Lies between (2^63 + 2^32 + 0) * 2^-63 and (2^63 + 2^32 + 1) * 2^-63
and is closer to (2^63 + 2^32 + 1) * 2^-63, therefore the rounding
must round up and produce (2^63 + 2^32 + 1) * 2^-63. */
volatile long double expected =
1.0L + ldexpl (1.0L, 1 - LDBL_MANT_DIG / 2) + ldexpl (1.0L, 1 - LDBL_MANT_DIG);
volatile long double result = fmal (x, y, z);
if (result != expected)
failed_tests |= 8;
}
{
volatile long double x = 1.0L + ldexpl (1.0L, - LDBL_MANT_DIG / 2); /* 2^0 + 2^-32 */
volatile long double y = x;
volatile long double z = ldexpl (1.0L, - LDBL_MANT_DIG); /* 2^-64 */
/* x * y + z with infinite precision: 2^0 + 2^-31 + 2^-63.
Rounding must return this value unchanged. */
volatile long double expected = 1.0L + ldexpl (1.0L, 1 - LDBL_MANT_DIG / 2) + ldexpl (1.0L, 1 - LDBL_MANT_DIG);
volatile long double result = fmal (x, y, z);
if (result != expected)
failed_tests |= 8;
}
{
volatile long double x = 1.0L + ldexpl (1.0L, - LDBL_MANT_DIG / 2); /* 2^0 + 2^-32 */
volatile long double y = x;
volatile long double z = ldexpl (1.0L, 1 - LDBL_MANT_DIG); /* 2^-63 */
/* x * y + z with infinite precision: 2^0 + 2^-31 + 2^-63 + 2^-64.
Lies between (2^63 + 2^32 + 1) * 2^-63 and (2^63 + 2^32 + 2) * 2^-63
and is at the same distance from each. According to the round-to-even
rule, the rounding must round up and produce (2^63 + 2^32 + 2) * 2^-63. */
volatile long double expected = 1.0L + ldexpl (1.0L, -31) + ldexpl (1.0L, -62);
volatile long double result = fmal (x, y, z);
if (result != expected)
failed_tests |= 8;
}
{
volatile long double x = 1.0L + ldexpl (1.0L, - LDBL_MANT_DIG / 2); /* 2^0 + 2^-32 */
volatile long double y = x;
volatile long double z = ldexpl (1.0L, LDBL_MANT_DIG / 2 + 1); /* 2^33 */
/* x * y + z with infinite precision: 2^33 + 2^0 + 2^-31 + 2^-64.
Lies between (2^63 + 2^30) * 2^-30 and (2^63 + 2^30 + 1) * 2^-30
and is closer to (2^63 + 2^30 + 1) * 2^-30, therefore the rounding
must round up and produce (2^63 + 2^30 + 1) * 2^-30. */
volatile long double expected = z + 1.0L + ldexp (1.0L, 2 - LDBL_MANT_DIG / 2);
volatile long double result = fmal (x, y, z);
if (result != expected)
failed_tests |= 8;
}
{
volatile long double x = 1.0L + ldexpl (1.0L, - LDBL_MANT_DIG / 2); /* 2^0 + 2^-32 */
volatile long double y = x;
volatile long double z = - ldexpl (1.0, 1 - LDBL_MANT_DIG); /* - 2^-63 */
/* x * y + z with infinite precision: 2^0 + 2^-31 - 2^-64.
Lies between (2^63 + 2^32 - 1) * 2^-63 and (2^63 + 2^32) * 2^-63
and is at the same distance from each. According to the round-to-even
rule, the rounding must round up and produce (2^63 + 2^32) * 2^-63. */
volatile long double expected = 1.0L + ldexpl (1.0L, 1 - LDBL_MANT_DIG / 2);
volatile long double result = fmal (x, y, z);
if (result != expected)
failed_tests |= 8;
}
{
volatile long double x = 1.0L + ldexpl (1.0L, - LDBL_MANT_DIG / 2); /* 2^0 + 2^-32 */
volatile long double y = x;
volatile long double z = - 1.0L; /* - 2^0 */
/* x * y + z with infinite precision: 2^-31 + 2^-64.
Rounding must return this value unchanged. */
volatile long double expected = ldexpl (1.0L, 1 - LDBL_MANT_DIG / 2) + ldexpl (1.0L, - LDBL_MANT_DIG);
volatile long double result = fmal (x, y, z);
if (result != expected)
failed_tests |= 8;
}
{
volatile long double x = 1.0L + ldexpl (1.0L, - LDBL_MANT_DIG / 2); /* 2^0 + 2^-32 */
volatile long double y = - x;
volatile long double z = 2.0L; /* 2^1 */
/* x * y + z with infinite precision: 2^0 - 2^31 - 2^-64.
Rounding must return this value unchanged. */
volatile long double expected = 1.0L - ldexpl (1.0L, 1 - LDBL_MANT_DIG / 2) - ldexpl (1.0L, - LDBL_MANT_DIG);
volatile long double result = fmal (x, y, z);
if (result != expected)
failed_tests |= 8;
}
{
volatile long double x = 1.0L + ldexpl (1.0L, - LDBL_MANT_DIG / 2); /* 2^0 + 2^-32 */
volatile long double y = - x;
volatile long double z = ldexpl (1.0L, LDBL_MANT_DIG / 2 + 2); /* 2^34 */
/* x * y + z with infinite precision: 2^34 - (2^0 + 2^-31 + 2^-64).
Lies between (2^64 - 2^30 - 1) * 2^-30 and (2^64 - 2^30) * 2^-30
and is closer to (2^64 - 2^30 - 1) * 2^-30, therefore the rounding
must round down and produce (2^64 - 2^30 - 1) * 2^-30. */
volatile long double expected = z - 1.0L - ldexpl (1.0L, 2 - LDBL_MANT_DIG / 2);
volatile long double result = fmal (x, y, z);
if (result != expected)
failed_tests |= 8;
}
{
volatile long double x = 1.0L + ldexpl (1.0L, - LDBL_MANT_DIG / 2 - 1); /* 2^0 + 2^-33 */
volatile long double y = 1.0L - ldexpl (1.0L, - LDBL_MANT_DIG / 2 - 1); /* 2^0 - 2^-33 */
volatile long double z = - ldexpl (1.0L, - LDBL_MANT_DIG - 1); /* 2^-65 */
/* x * y + z with infinite precision: 2^0 - 2^-65 - 2^-66.
Lies between (2^64 - 1) * 2^-64 and 2^64 * 2^-64 and is closer to
(2^64 - 1) * 2^-64, therefore the rounding must round down and
produce (2^64 - 1) * 2^-64. */
volatile long double expected = 1.0L - ldexpl (1.0L, - LDBL_MANT_DIG);
volatile long double result = fmal (x, y, z);
if (result != expected)
failed_tests |= 8;
}
{
volatile long double x = 1.0L + ldexpl (1.0L, - LDBL_MANT_DIG / 2 - 1); /* 2^0 + 2^-33 */
volatile long double y = 1.0L - ldexpl (1.0L, - LDBL_MANT_DIG / 2 - 1); /* 2^0 - 2^-33 */
volatile long double z = - 1.0L; /* 2^0 */
/* x * y + z with infinite precision: - 2^-66.
Rounding must return this value unchanged. */
volatile long double expected = - ldexpl (1.0L, - LDBL_MANT_DIG - 2);
volatile long double result = fmal (x, y, z);
if (result != expected)
failed_tests |= 8;
}
/* This test fails on glibc 2.11 x86,x86_64,powerpc, glibc 2.7 hppa,sparc,
FreeBSD 6.4 x86, mingw. */
{
long double minus_inf = -1.0L / p0;
volatile long double x = ldexpl (1.0L, LDBL_MAX_EXP - 1);
volatile long double y = ldexpl (1.0L, LDBL_MAX_EXP - 1);
volatile long double z = minus_inf;
volatile long double result = fmal (x, y, z);
if (!(result == minus_inf))
failed_tests |= 16;
}
/* This test fails on glibc 2.11 x86,x86_64,powerpc glibc 2.7 hppa,sparc,
Mac OS X 10.5, FreeBSD 6.4 x86, OSF/1 5.1, mingw. */
{
volatile long double x = ldexpl (1.0L, LDBL_MAX_EXP - 1);
volatile long double y = 2.0L;
volatile long double z =
- ldexpl (ldexpl (1.0L, LDBL_MAX_EXP - 1) - ldexpl (1.0L, LDBL_MAX_EXP - LDBL_MANT_DIG - 1), 1);
volatile long double expected = ldexpl (1.0L, LDBL_MAX_EXP - LDBL_MANT_DIG);
volatile long double result = fmal (x, y, z);
if (result != expected)
failed_tests |= 32;
}
return failed_tests;
}
===============================================================================
* fnmatch.o
This is due to
checking for working POSIX fnmatch... no
Exit status was 1.
Test case:
===============================================================================
#include <fnmatch.h>
static int
y (char const *pattern, char const *string, int flags)
{
return fnmatch (pattern, string, flags) == 0;
}
static int
n (char const *pattern, char const *string, int flags)
{
return fnmatch (pattern, string, flags) == FNM_NOMATCH;
}
int main ()
{
char const *Apat = 'A' < '\\\\' ? "[A-\\\\\\\\]" : "[\\\\\\\\-A]";
char const *apat = 'a' < '\\\\' ? "[a-\\\\\\\\]" : "[\\\\\\\\-a]";
static char const A_1[] = { 'A' - 1, 0 };
static char const A01[] = { 'A' + 1, 0 };
static char const a_1[] = { 'a' - 1, 0 };
static char const a01[] = { 'a' + 1, 0 };
static char const bs_1[] = { '\\\\' - 1, 0 };
static char const bs01[] = { '\\\\' + 1, 0 };
int result = 0;
if (!n ("a*", "", 0))
return 1;
if (!y ("a*", "abc", 0))
return 1;
if (!y ("[/b", "[/b", 0)) /*"]]"*/ /* glibc Bugzilla bug 12378 */
return 1;
return result;
}
===============================================================================
Strange, <http://sourceware.org/bugzilla/show_bug.cgi?id=12378> was supposed
to be fixed?
* getcwd.o
This is due to
checking whether getcwd handles long file names properly... no, but it is partly working
Test program is in getcwd-path-max.m4. Haven't investigated.
* logf.o
This is due to
checking for logf... no
It appears that logf() is not present at link time. Can you do
"nm libm.so | grep logf" ?
* log10f.o
This is due to the mistake in gnulib, fixed now at
http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commitdiff;h=273bfd77e1807f9e9137b2efd7ab47c86374498b
* logb.o
This is due to
checking whether logb works... no
Test program:
===============================================================================
#include <float.h>
#include <math.h>
extern double logb (double);
volatile double x;
int main ()
{
int i;
for (i = 1, x = 1.0; i >= DBL_MIN_EXP; i--, x *= 0.5)
;
/* Here i = DBL_MIN_EXP - 1. Either x = 2^(i-1) is subnormal or x = 0.0. */
if (x > 0.0 && !(logb (x) == (double)(i - 1)))
return 1;
return 0;
}
===============================================================================
Strange, <http://sourceware.org/bugzilla/show_bug.cgi?id=13954> was supposed
to be fixed?
* logbf.o
This is due to
checking whether logbf works... no
Test program:
===============================================================================
#include <float.h>
#include <math.h>
volatile float x;
int main ()
{
int i;
for (i = 1, x = 1.0f; i >= FLT_MIN_EXP; i--, x *= 0.5f)
;
/* Here i = FLT_MIN_EXP - 1. Either x = 2^(i-1) is subnormal or x = 0.0. */
if (x > 0.0f && !(logbf (x) == (float)(i - 1)))
return 1;
return 0;
}
===============================================================================
Strange, <http://sourceware.org/bugzilla/show_bug.cgi?id=13955> was supposed
to be fixed?
* remove.o
This is due to the mistake in gnulib, fixed now at
http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commitdiff;h=6e94a9a960fdebf2c58859e94974256dca75ab05
* strerror.o, perror.o
This is due to
checking whether __xpg_strerror_r works... no
Test case:
===============================================================================
#include <errno.h>
#include <string.h>
extern int __xpg_strerror_r(int, char *, size_t);
int main ()
{
int result = 0;
char buf[256] = "^";
char copy[256];
char *str = strerror (-1);
strcpy (copy, str);
if (__xpg_strerror_r (-2, buf, 1) == 0)
result |= 1;
if (*buf)
result |= 2;
__xpg_strerror_r (-2, buf, 256);
if (strcmp (str, copy))
result |= 4;
return result;
}
===============================================================================
This is because when Ulrich fixed
<http://sourceware.org/bugzilla/show_bug.cgi?id=12782>
he introduced another bug. See comment 3 in that bugzilla.
* strstr.o
This is due to quadratic running time.
Bruno