about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndrew Stubbs <ams@codesourcery.com>2010-05-12 10:18:26 -0700
committerPetr Baudis <pasky@ucw.cz>2010-05-19 22:38:15 +0200
commit6be390f354c24eb6adf7c234f5b0beb4c657a6fd (patch)
tree0a92710c0dc61db3fa9a046fc5eb53ba3ae607c8
parent6d270188ef3fe10125b8723ed69ebdc9e90e914e (diff)
downloadglibc-6be390f354c24eb6adf7c234f5b0beb4c657a6fd.tar.gz
glibc-6be390f354c24eb6adf7c234f5b0beb4c657a6fd.tar.xz
glibc-6be390f354c24eb6adf7c234f5b0beb4c657a6fd.zip
Fix FP exception control.
(cherry picked from commit 21a2b1aeeb9bbf49d76bac632327c19bc937d2d7)
-rw-r--r--ChangeLog5
-rw-r--r--sysdeps/sh/sh4/fpu/feholdexcpt.c12
2 files changed, 14 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 5e6a6b20f8..bb4e4d5dad 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-05-12  Andrew Stubbs  <ams@codesourcery.com>
+
+	* sysdeps/sh/sh4/fpu/feholdexcpt.c (feholdexcept): Really disable all
+	exceptions.  Return 0.
+
 2010-05-07  Roland McGrath  <roland@redhat.com>
 
 	* elf/ldconfig.c (main): Add a const.
diff --git a/sysdeps/sh/sh4/fpu/feholdexcpt.c b/sysdeps/sh/sh4/fpu/feholdexcpt.c
index 7aac5a0d39..87d6420891 100644
--- a/sysdeps/sh/sh4/fpu/feholdexcpt.c
+++ b/sysdeps/sh/sh4/fpu/feholdexcpt.c
@@ -1,5 +1,6 @@
 /* Store current floating-point environment and clear exceptions.
-   Copyright (C) 1997, 1998, 1999, 2000, 2005 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998, 1999, 2000, 2005, 2010
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -29,10 +30,15 @@ feholdexcept (fenv_t *envp)
   _FPU_GETCW (temp);
   envp->__fpscr = temp;
 
-  /* Now set all exceptions to non-stop.  */
+  /* Clear the status flags.  */
   temp &= ~FE_ALL_EXCEPT;
+
+  /* Now set all exceptions to non-stop.  */
+  temp &= ~(FE_ALL_EXCEPT << 5);
+
   _FPU_SETCW (temp);
 
-  return 1;
+  /* Success.  */
+  return 0;
 }
 libm_hidden_def (feholdexcept)