]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix FP exception control.
authorAndrew Stubbs <ams@codesourcery.com>
Wed, 12 May 2010 17:18:26 +0000 (10:18 -0700)
committerPetr Baudis <pasky@ucw.cz>
Wed, 19 May 2010 20:38:15 +0000 (22:38 +0200)
(cherry picked from commit 21a2b1aeeb9bbf49d76bac632327c19bc937d2d7)

ChangeLog
sysdeps/sh/sh4/fpu/feholdexcpt.c

index 5e6a6b20f8912aac2945f1d49201a19f275ccaf6..bb4e4d5dadf6c40796e19c9bf8edc6a1f73b2b9f 100644 (file)
--- 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.
index 7aac5a0d39e71153d8e92ddcc51ac338401c8a68..87d642089111adc3053e6f60da11849960eb71d4 100644 (file)
@@ -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)