summaryrefslogtreecommitdiffstats
path: root/lib/msun/src/s_atan.c
diff options
context:
space:
mode:
authordas <das@FreeBSD.org>2008-07-31 19:57:50 +0000
committerdas <das@FreeBSD.org>2008-07-31 19:57:50 +0000
commit9f333dcb2cca361c8dcfe7743d1061e62e59913a (patch)
tree1eeb1f3e2bd18382c5a4cd6b9eac79e12656a791 /lib/msun/src/s_atan.c
parent99ec4c843d18fdc20a8ba8ec77c64558085c8794 (diff)
downloadFreeBSD-src-9f333dcb2cca361c8dcfe7743d1061e62e59913a.zip
FreeBSD-src-9f333dcb2cca361c8dcfe7743d1061e62e59913a.tar.gz
As in other parts of libm, mark a few constants as volatile to prevent
spurious optimizations. gcc doesn't support FENV_ACCESS, so when it folds constants, it assumes that the rounding mode is always the default and floating point exceptions never matter.
Diffstat (limited to 'lib/msun/src/s_atan.c')
-rw-r--r--lib/msun/src/s_atan.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/msun/src/s_atan.c b/lib/msun/src/s_atan.c
index 4b0ab89..01e7bea 100644
--- a/lib/msun/src/s_atan.c
+++ b/lib/msun/src/s_atan.c
@@ -82,8 +82,8 @@ atan(double x)
if(ix>0x7ff00000||
(ix==0x7ff00000&&(low!=0)))
return x+x; /* NaN */
- if(hx>0) return atanhi[3]+atanlo[3];
- else return -atanhi[3]-atanlo[3];
+ if(hx>0) return atanhi[3]+*(volatile double *)&atanlo[3];
+ else return -atanhi[3]-*(volatile double *)&atanlo[3];
} if (ix < 0x3fdc0000) { /* |x| < 0.4375 */
if (ix < 0x3e200000) { /* |x| < 2^-29 */
if(huge+x>one) return x; /* raise inexact */
OpenPOWER on IntegriCloud