cpython: d9c85b6bab3a (original) (raw)
Mercurial > cpython
changeset 97365:d9c85b6bab3a 2.7
#21167: Fix definition of NAN when ICC used without -fp-model strict. Patch from Chris Hogan of Intel, reviewed by Mark Dickinson. [#21167]
R David Murray rdmurray@bitdance.com | |
---|---|
date | Thu, 13 Aug 2015 09:48:35 -0400 |
parents | 089f1a23dfac |
children | 208d6d14c2a3 |
files | Include/pymath.h Misc/ACKS Misc/NEWS |
diffstat | 3 files changed, 27 insertions(+), 1 deletions(-)[+] [-] Include/pymath.h 24 Misc/ACKS 1 Misc/NEWS 3 |
line wrap: on
line diff
--- a/Include/pymath.h +++ b/Include/pymath.h @@ -152,7 +152,29 @@ PyAPI_FUNC(void) _Py_set_387controlword(
#if !defined(Py_NAN) && !defined(Py_NO_NAN) -#define Py_NAN (Py_HUGE_VAL * 0.) +#if !defined(__INTEL_COMPILER)
- #if defined(ICC_NAN_STRICT)
#pragma float_control(push)[](#l1.12)
#pragma float_control(precise, on)[](#l1.13)
#pragma float_control(except, on)[](#l1.14)
#if defined(_MSC_VER)[](#l1.15)
__declspec(noinline)[](#l1.16)
#else /* Linux */[](#l1.17)
__attribute__((noinline))[](#l1.18)
#endif /* _MSC_VER */[](#l1.19)
static double __icc_nan()[](#l1.20)
{[](#l1.21)
return sqrt(-1.0);[](#l1.22)
}[](#l1.23)
#pragma float_control (pop)[](#l1.24)
#define Py_NAN __icc_nan()[](#l1.25)
- #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};[](#l1.27)
#define Py_NAN (__nan_store.__icc_nan)[](#l1.28)
- #endif /* ICC_NAN_STRICT */
+#endif /* __INTEL_COMPILER / #endif / Py_OVERFLOWED(X)
--- a/Misc/ACKS +++ b/Misc/ACKS @@ -573,6 +573,7 @@ Gregor Hoffleit Chris Hoffman Stefan Hoffmeister Albert Hofkamp +Chris Hogan Tomas Hoger Jonathan Hogg Kamilla Holanda
--- a/Misc/NEWS +++ b/Misc/NEWS @@ -10,6 +10,9 @@ What's New in Python 2.7.11? Core and Builtins ----------------- +- Issue #21167: NAN operations are now handled correctly when python is