-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Bruno Haible on 9/13/2008 2:52 AM: >> Meanwhile, I have a question about tests/test-signbit.c - your >> patch changed most occurrences of -0.0L to -zerol, to work around one HP >> bug, but there is another comment that states: >> >> /* We cannot use the expression '-zerol' here, because on HP-UX/hppa it >> evaluates to 0.0L, not -0.0L. */ >> long double minus_zerol = -0.0L; > > Indeed, we're in a maze of twisty little HP cc compiler bugs: > <http://lists.gnu.org/archive/html/bug-gnulib/2008-04/msg00179.html> > <http://lists.gnu.org/archive/html/bug-gnulib/2008-08/msg00000.html>
minus_zerol is miscompiled on at least Irix 6.2. So until we hear feedback from Jonathan on what DOES allow us to compile -0.0L on HP-UX/hppa, I'd rather go for consistency in the testsuite by always using - -zerol as the common idiom. If we later find a way to reliably work around the HP-UX bug, it will then be a matter of grepping the source for - -zerol and replacing it with a function call to a helper function (similar to the NaNl() helper function in tests/nan.h). I'm committing this: - -- Don't work too hard, make some time for fun as well! Eric Blake [EMAIL PROTECTED] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkjqA60ACgkQ84KuGfSFAYCM6wCbBdZnvB6QuLS3ZREJgR5pvd8j cT0AoJXK0nOb6AKY31vxcMT5dmhWV7Kq =+TN4 -----END PGP SIGNATURE-----
>From 9374a8b4bcd3167f3bb4a068d0571dc9ef7b9d6e Mon Sep 17 00:00:00 2001 From: Eric Blake <[EMAIL PROTECTED]> Date: Mon, 6 Oct 2008 06:23:12 -0600 Subject: [PATCH] test-signbit: avoid tripping Irix cc bug on -0.0L * tests/test-signbit.c (minus_zerol): Delete, and replace with '-zerol'. This may break on HP-UX/hppa, but at least makes the entire testsuite consistent and avoids an Irix 6.2 bug. Signed-off-by: Eric Blake <[EMAIL PROTECTED]> --- ChangeLog | 7 +++++++ tests/test-signbit.c | 5 +---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index e7db985..5345c11 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-10-06 Eric Blake <[EMAIL PROTECTED]> + + test-signbit: avoid tripping Irix cc bug on -0.0L + * tests/test-signbit.c (minus_zerol): Delete, and replace with + '-zerol'. This may break on HP-UX/hppa, but at least makes the + entire testsuite consistent and avoids an Irix 6.2 bug. + 2008-10-05 Bruno Haible <[EMAIL PROTECTED]> Jim Meyering <[EMAIL PROTECTED]> diff --git a/tests/test-signbit.c b/tests/test-signbit.c index 30ba1b0..95ba613 100644 --- a/tests/test-signbit.c +++ b/tests/test-signbit.c @@ -39,9 +39,6 @@ float zerof = 0.0f; double zerod = 0.0; long double zerol = 0.0L; -/* We cannot use the expression '-zerol' here, because on HP-UX/hppa it - evaluates to 0.0L, not -0.0L. */ -long double minus_zerol = -0.0L; static void test_signbitf () @@ -143,7 +140,7 @@ test_signbitl () ASSERT (signbit (-2.718e-30L)); /* Zeros. */ ASSERT (!signbit (0.0L)); - if (1.0L / minus_zerol < 0) + if (1.0L / -zerol < 0) ASSERT (signbit (-zerol)); else ASSERT (!signbit (-zerol)); -- 1.6.0.2