bug-gnulib
[Top][All Lists]
Advanced

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

[PATCH] isnanl: work around icc bug


From: Eric Blake
Subject: [PATCH] isnanl: work around icc bug
Date: Thu, 4 Nov 2010 16:46:44 -0600

* lib/isnan.c (FUNC): Compute run-time NaN under ICC as well.

Signed-off-by: Eric Blake <address@hidden>
---

On a Linux x86_64 system where isnan() fails to recognize pseudo-nan
long doubles, ICC 10.1 fails to compile isnan.c with:

../../gllib/isnan.c(133): error: floating-point operation result is out of range
    static memory_double nan = { L_(0.0) / L_(0.0) };
                                         ^

../../gllib/isnan.c(134): error: floating-point operation result is out of range
    static DOUBLE plus_inf = L_(1.0) / L_(0.0);
                                     ^

../../gllib/isnan.c(135): error: floating-point operation result is out of range
    static DOUBLE minus_inf = -L_(1.0) / L_(0.0);


 ChangeLog   |    5 ++++-
 lib/isnan.c |    4 ++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 68c0a75..7f1a824 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,7 @@
-2010-11-03  Eric Blake  <address@hidden>
+2010-11-04  Eric Blake  <address@hidden>
+
+       isnan: work around icc bug
+       * lib/isnan.c (FUNC): Compute run-time NaN under ICC as well.

        tests: fix compiler warnings
        * tests/test-getopt.h (test_getopt): Fix condition.
diff --git a/lib/isnan.c b/lib/isnan.c
index ddad7fb..d183ac4 100644
--- a/lib/isnan.c
+++ b/lib/isnan.c
@@ -118,8 +118,8 @@ FUNC (DOUBLE x)
   /* Be careful to not do any floating-point operation on x, such as x == x,
      because x may be a signaling NaN.  */
 #  if defined __TINYC__ || defined __SUNPRO_C || defined __DECC \
-      || (defined __sgi && !defined __GNUC__)
-  /* The Sun C 5.0 compilers and the Compaq (ex-DEC) 6.4 compilers don't
+      || (defined __sgi && !defined __GNUC__) || defined __ICC
+  /* The Sun C 5.0, Intel ICC 10.0, and Compaq (ex-DEC) 6.4 compilers don't
      recognize the initializers as constant expressions.  The latter compiler
      also fails when constant-folding 0.0 / 0.0 even when constant-folding is
      not required.  The SGI MIPSpro C compiler complains about "floating-point
-- 
1.7.3.2




reply via email to

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