aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/ieee754/dbl-64/s_nearbyint.c
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2013-05-19 18:40:25 +0000
committerJoseph Myers <joseph@codesourcery.com>2013-05-19 18:40:25 +0000
commit3e694268750d51acc6a68b0ee7ded25a52902c20 (patch)
treedea529a863349fc82263de39b239742a00845031 /sysdeps/ieee754/dbl-64/s_nearbyint.c
parentdb62a9075305963281572cb990d1c766948bae7b (diff)
downloadglibc-3e694268750d51acc6a68b0ee7ded25a52902c20.zip
glibc-3e694268750d51acc6a68b0ee7ded25a52902c20.tar.gz
glibc-3e694268750d51acc6a68b0ee7ded25a52902c20.tar.bz2
Fix nearbyint scheduling of arithmetic past fesetenv (bug 15490).
Diffstat (limited to 'sysdeps/ieee754/dbl-64/s_nearbyint.c')
-rw-r--r--sysdeps/ieee754/dbl-64/s_nearbyint.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sysdeps/ieee754/dbl-64/s_nearbyint.c b/sysdeps/ieee754/dbl-64/s_nearbyint.c
index eb40c29..5017f47 100644
--- a/sysdeps/ieee754/dbl-64/s_nearbyint.c
+++ b/sysdeps/ieee754/dbl-64/s_nearbyint.c
@@ -47,6 +47,7 @@ double __nearbyint(double x)
libc_feholdexcept (&env);
w = TWO52[sx]+x;
t = w-TWO52[sx];
+ math_force_eval (t);
libc_fesetenv (&env);
GET_HIGH_WORD(i0,t);
SET_HIGH_WORD(t,(i0&0x7fffffff)|(sx<<31));
@@ -59,6 +60,7 @@ double __nearbyint(double x)
libc_feholdexcept (&env);
w = TWO52[sx]+x;
t = w-TWO52[sx];
+ math_force_eval (t);
libc_fesetenv (&env);
return t;
}