aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.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/ldbl-128ibm/s_nearbyintl.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/ldbl-128ibm/s_nearbyintl.c')
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c b/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c
index b654bf5..bfcd110 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c
@@ -21,6 +21,7 @@
when it's coded in C. */
#include <math.h>
+#include <math_private.h>
#include <fenv.h>
#include <math_ldbl_opt.h>
#include <float.h>
@@ -53,6 +54,8 @@ __nearbyintl (long double x)
}
u.dd[0] = high;
u.dd[1] = 0.0;
+ math_force_eval (u.dd[0]);
+ math_force_eval (u.dd[1]);
fesetenv (&env);
}
else if (fabs (u.dd[1]) < TWO52 && u.dd[1] != 0.0)
@@ -109,6 +112,8 @@ __nearbyintl (long double x)
}
u.dd[0] = high + low;
u.dd[1] = high - u.dd[0] + low;
+ math_force_eval (u.dd[0]);
+ math_force_eval (u.dd[1]);
fesetenv (&env);
}