This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

ia64 libm update broke nextafterl


On Tue, Nov 23, 2004 at 09:33:12PM -0800, David Mosberger wrote:
> The latest ia64 libm update patch is now available at:
> 
>  ftp://ftp.hpl.hp.com/pub/linux-ia64/libc-intel-libm-v2.1-update-041123.diff.gz
>  md5sum: 51f780c07a7467281d038f49de33c8d9

It seems that this update broke nextafterl:

#include <float.h>
#include <math.h>
#include <stdlib.h>

int
main (void)
{
  union { long double d; unsigned long int x[2]; } v;

  v.d = nextafterl (nextafterl (LDBL_MIN, LDBL_MIN / 2.0), LDBL_MIN);
  if (v.x[0] != 0x8000000000000000L)
    abort ();
  return 0;
}

or:

#include <float.h>
#include <math.h>
#include <stdlib.h>

int
main (void)
{
  if (nextafterl (nextafterl (LDBL_MIN, LDBL_MIN / 2.0), LDBL_MIN) != LDBL_MIN)
    abort ();
  return 0;
}

used to work before but now fails.
The first call to nextafterl is with:
f8             0        (raw 0x000000000000c0018000000000000000)
f9             0        (raw 0x00000000000000004000000000000000)
and returns on current CVS glibc:
f8             0      (raw 0x000000000000c0007fffffffffffffff)
while on stock 2.3.4:
f8             0        (raw 0x00000000000000007fffffffffffffff)

The second call gets with CVS glibc:
f8             0      (raw 0x000000000000c0007fffffffffffffff)
f9             0      (raw 0x000000000000c0018000000000000000)
but on 2.3.4:
f8             0        (raw 0x00000000000000007fffffffffffffff)
f9             0        (raw 0x000000000000c0018000000000000000)
and returns on CVS glibc:
f8             0      (raw 0x00000000000000004000000000000000)
while on 2.3.4:
f8             0        (raw 0x000000000000c0018000000000000000)

0x000000000000c0007fffffffffffffff doesn't sound like correct
denormal format.

The above test comes from test-misc.c, but there for some reason
GCC < 4 normalizes the values or something, but GCC 4 does not.
But the above distilled testcases fail with CVS glibc no matter
if -O0 or -O2 and no matter if using GCC 3.3.4, 3.4.3 or 4.0pre
and pass when moving the unmodified binaries to older glibc.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]