diff options
author | kargl <kargl@FreeBSD.org> | 2014-08-30 17:14:47 +0000 |
---|---|---|
committer | kargl <kargl@FreeBSD.org> | 2014-08-30 17:14:47 +0000 |
commit | b2711b749f59c632287dc892fd5c9c04abd179cf (patch) | |
tree | 434686dc7b4d5767a56bd54b5349ee8f0abbfd25 /lib/msun/src | |
parent | 27db27f3212304d33501e9b7da7dfd692e4882fa (diff) | |
download | FreeBSD-src-b2711b749f59c632287dc892fd5c9c04abd179cf.zip FreeBSD-src-b2711b749f59c632287dc892fd5c9c04abd179cf.tar.gz |
Make tiny volatile to prevent the compiler(s) from
constant folding expressions of the form "1 - tiny",
which are used to raise FE_INEXACT.
Diffstat (limited to 'lib/msun/src')
-rw-r--r-- | lib/msun/src/s_tanh.c | 3 | ||||
-rw-r--r-- | lib/msun/src/s_tanhf.c | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/msun/src/s_tanh.c b/lib/msun/src/s_tanh.c index f7b71c5..27197b0 100644 --- a/lib/msun/src/s_tanh.c +++ b/lib/msun/src/s_tanh.c @@ -42,7 +42,8 @@ __FBSDID("$FreeBSD$"); #include "math.h" #include "math_private.h" -static const double one = 1.0, two = 2.0, tiny = 1.0e-300, huge = 1.0e300; +static volatile const double tiny = 1.0e-300; +static const double one = 1.0, two = 2.0, huge = 1.0e300; double tanh(double x) diff --git a/lib/msun/src/s_tanhf.c b/lib/msun/src/s_tanhf.c index 04f09c6..d6a3634 100644 --- a/lib/msun/src/s_tanhf.c +++ b/lib/msun/src/s_tanhf.c @@ -19,7 +19,9 @@ __FBSDID("$FreeBSD$"); #include "math.h" #include "math_private.h" -static const float one=1.0, two=2.0, tiny = 1.0e-30, huge = 1.0e30; +static volatile const float tiny = 1.0e-30; +static const float one=1.0, two=2.0, huge = 1.0e30; + float tanhf(float x) { |