about summary refs log tree commit diff
path: root/sysdeps/ieee754/ldbl-96
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/ldbl-96
parentdb62a9075305963281572cb990d1c766948bae7b (diff)
downloadglibc-3e694268750d51acc6a68b0ee7ded25a52902c20.tar.gz
glibc-3e694268750d51acc6a68b0ee7ded25a52902c20.tar.xz
glibc-3e694268750d51acc6a68b0ee7ded25a52902c20.zip
Fix nearbyint scheduling of arithmetic past fesetenv (bug 15490).
Diffstat (limited to 'sysdeps/ieee754/ldbl-96')
-rw-r--r--sysdeps/ieee754/ldbl-96/s_nearbyintl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sysdeps/ieee754/ldbl-96/s_nearbyintl.c b/sysdeps/ieee754/ldbl-96/s_nearbyintl.c
index ed9836c879..c1d77f0c02 100644
--- a/sysdeps/ieee754/ldbl-96/s_nearbyintl.c
+++ b/sysdeps/ieee754/ldbl-96/s_nearbyintl.c
@@ -54,6 +54,7 @@ long double __nearbyintl(long double x)
 		feholdexcept (&env);
 	        w = TWO63[sx]+x;
 	        t = w-TWO63[sx];
+		math_force_eval (t);
 		fesetenv (&env);
 		GET_LDOUBLE_EXP(i0,t);
 		SET_LDOUBLE_EXP(t,(i0&0x7fff)|(sx<<15));
@@ -80,6 +81,7 @@ long double __nearbyintl(long double x)
 	feholdexcept (&env);
 	w = TWO63[sx]+x;
 	t = w-TWO63[sx];
+	math_force_eval (t);
 	fesetenv (&env);
 	return t;
 }