about summary refs log tree commit diff
path: root/sysdeps/x86_64/fpu/fegetenv.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/x86_64/fpu/fegetenv.c')
-rw-r--r--sysdeps/x86_64/fpu/fegetenv.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sysdeps/x86_64/fpu/fegetenv.c b/sysdeps/x86_64/fpu/fegetenv.c
index 364f917719..0e0c269375 100644
--- a/sysdeps/x86_64/fpu/fegetenv.c
+++ b/sysdeps/x86_64/fpu/fegetenv.c
@@ -22,6 +22,9 @@ int
 fegetenv (fenv_t *envp)
 {
   __asm__ ("fnstenv %0\n"
+	   /* fnstenv changes the exception mask, so load back the
+	      stored environment.  */
+	   "fldenv %0\n"
 	   "stmxcsr %1" : "=m" (*envp), "=m" (envp->__mxcsr));
 
   /* Success.  */