summary refs log tree commit diff
path: root/sysdeps/mips/fpu/fraiseexcpt.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/mips/fpu/fraiseexcpt.c')
-rw-r--r--sysdeps/mips/fpu/fraiseexcpt.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sysdeps/mips/fpu/fraiseexcpt.c b/sysdeps/mips/fpu/fraiseexcpt.c
index 582210aca3..e2472e35f2 100644
--- a/sysdeps/mips/fpu/fraiseexcpt.c
+++ b/sysdeps/mips/fpu/fraiseexcpt.c
@@ -1,5 +1,5 @@
 /* Raise given exceptions.
-   Copyright (C) 2000 Free Software Foundation, Inc.
+   Copyright (C) 2000, 2002 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Andreas Jaeger <aj@suse.de>, 2000.
 
@@ -19,6 +19,7 @@
    02111-1307 USA.  */
 
 #include <fenv.h>
+#include <fenv_libc.h>
 #include <fpu_control.h>
 #include <shlib-compat.h>
 
@@ -30,8 +31,13 @@ __feraiseexcept (int excepts)
   /* Get current state.  */
   _FPU_GETCW (cw);
 
-  /* Set exceptions bits.  */
-  cw |= (excepts & FE_ALL_EXCEPT);
+  /* Set flag bits (which are accumulative), and *also* set the cause
+     bits.  The setting of the cause bits is what actually causes the
+     hardware to generate the exception, if the corresponding enable
+     bit is set as well.  */
+
+  excepts &= FE_ALL_EXCEPT;
+  cw |= excepts | (excepts << CAUSE_SHIFT);
 
   /* Set new state.  */
   _FPU_SETCW (cw);