changeset: 97367:e3008318f76b branch: 3.5 parent: 97363:51d00482d403 parent: 97366:5e71a489f01d user: R David Murray date: Thu Aug 13 10:04:21 2015 -0400 files: Misc/ACKS Misc/NEWS description: Merge: #21167: Fix definition of NAN when ICC used without -fp-model strict. diff -r 51d00482d403 -r e3008318f76b Include/pymath.h --- a/Include/pymath.h Thu Aug 13 11:38:02 2015 +1200 +++ b/Include/pymath.h Thu Aug 13 10:04:21 2015 -0400 @@ -150,7 +150,29 @@ * doesn't support NaNs. */ #if !defined(Py_NAN) && !defined(Py_NO_NAN) -#define Py_NAN (Py_HUGE_VAL * 0.) +#if !defined(__INTEL_COMPILER) + #define Py_NAN (Py_HUGE_VAL * 0.) +#else /* __INTEL_COMPILER */ + #if defined(ICC_NAN_STRICT) + #pragma float_control(push) + #pragma float_control(precise, on) + #pragma float_control(except, on) + #if defined(_MSC_VER) + __declspec(noinline) + #else /* Linux */ + __attribute__((noinline)) + #endif /* _MSC_VER */ + static double __icc_nan() + { + return sqrt(-1.0); + } + #pragma float_control (pop) + #define Py_NAN __icc_nan() + #else /* ICC_NAN_RELAXED as default for Intel Compiler */ + static union { unsigned char buf[8]; double __icc_nan; } __nan_store = {0,0,0,0,0,0,0xf8,0x7f}; + #define Py_NAN (__nan_store.__icc_nan) + #endif /* ICC_NAN_STRICT */ +#endif /* __INTEL_COMPILER */ #endif /* Py_OVERFLOWED(X) diff -r 51d00482d403 -r e3008318f76b Misc/ACKS --- a/Misc/ACKS Thu Aug 13 11:38:02 2015 +1200 +++ b/Misc/ACKS Thu Aug 13 10:04:21 2015 -0400 @@ -594,6 +594,7 @@ Chris Hoffman Stefan Hoffmeister Albert Hofkamp +Chris Hogan Tomas Hoger Jonathan Hogg Kamilla Holanda diff -r 51d00482d403 -r e3008318f76b Misc/NEWS --- a/Misc/NEWS Thu Aug 13 11:38:02 2015 +1200 +++ b/Misc/NEWS Thu Aug 13 10:04:21 2015 -0400 @@ -10,6 +10,9 @@ Core and Builtins ----------------- +- Issue #21167: NAN operations are now handled correctly when python is + compiled with ICC even if -fp-model strict is not specified. + Library -------