bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

minus_zero-related tests fail to compile on ppc with recent gcc


From: Jim Meyering
Subject: minus_zero-related tests fail to compile on ppc with recent gcc
Date: Fri, 17 Oct 2008 20:47:03 +0200

Markus Armbruster <address@hidden> wrote:
> With the appended patch, koji ate it up:
> http://koji.fedoraproject.org/koji/taskinfo?taskID=886652

Great!  Thanks a lot, Markus.

Bruno, FYI, Markus discovered that
an upcoming idutils release fails to compile on ppc-based systems:
(details here http://koji.fedoraproject.org/koji/taskinfo?taskID=886563)
Here's his fix for the two tests that idutils uses.
Many more tests in gnulib are affected.

The problem seems to be that gcc cannot evaluate the RHS of the moved
statements at compile time on those systems, when they're at file scope.
Moving them into the functions where used makes it a run-time operation.

> diff -up idutils-4.3.91/gnulib-tests/test-isnanl.h~ 
> idutils-4.3.91/gnulib-tests/test-isnanl.h
> --- idutils-4.3.91/gnulib-tests/test-isnanl.h~        2008-10-17 
> 10:56:26.000000000 -0400
> +++ idutils-4.3.91/gnulib-tests/test-isnanl.h 2008-10-17 13:56:18.000000000 
> -0400
> @@ -35,13 +35,12 @@
>      }                                                                        
>      \
>    while (0)
>
> -/* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
> -   So we use minus_zero instead.  */
> -long double minus_zero = -LDBL_MIN * LDBL_MIN;
> -
>  int
>  main ()
>  {
> +  /* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
> +     So we use minus_zero instead.  */
> +  long double minus_zero = -LDBL_MIN * LDBL_MIN;
>    #define NWORDS \
>      ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned 
> int))
>    typedef union { unsigned int word[NWORDS]; long double value; }
> diff -up idutils-4.3.91/gnulib-tests/test-signbit.c~ 
> idutils-4.3.91/gnulib-tests/test-signbit.c
> --- idutils-4.3.91/gnulib-tests/test-signbit.c~       2008-10-17 
> 10:56:26.000000000 -0400
> +++ idutils-4.3.91/gnulib-tests/test-signbit.c        2008-10-17 
> 14:20:38.000000000 -0400
> @@ -49,10 +49,6 @@ long double zerol = 0.0L;
>  /* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
>     So we use -zerod instead.  */
>
> -/* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
> -   So we use minus_zerol instead.  */
> -long double minus_zerol = -LDBL_MIN * LDBL_MIN;
> -
>  static void
>  test_signbitf ()
>  {
> @@ -144,6 +140,10 @@ test_signbitd ()
>  static void
>  test_signbitl ()
>  {
> +  /* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
> +     So we use minus_zerol instead.  */
> +  long double minus_zerol = -LDBL_MIN * LDBL_MIN;
> +
>    /* Finite values.  */
>    ASSERT (!signbit (3.141L));
>    ASSERT (!signbit (3.141e30L));




reply via email to

[Prev in Thread] Current Thread [Next in Thread]