diff options
Diffstat (limited to 'sysdeps/powerpc/fpu/fedisblxcpt.c')
-rw-r--r-- | sysdeps/powerpc/fpu/fedisblxcpt.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sysdeps/powerpc/fpu/fedisblxcpt.c b/sysdeps/powerpc/fpu/fedisblxcpt.c index 633a6e6e36..3002b1b4cc 100644 --- a/sysdeps/powerpc/fpu/fedisblxcpt.c +++ b/sysdeps/powerpc/fpu/fedisblxcpt.c @@ -24,7 +24,7 @@ int fedisableexcept (int excepts) { fenv_union_t fe; - int result; + int result, new; result = fegetexcept (); @@ -44,7 +44,11 @@ fedisableexcept (int excepts) fe.l[1] &= ~(1 << (31 - FPSCR_VE)); fesetenv_register (fe.fenv); - if ((fegetexcept () & excepts) != 0) + new = fegetexcept (); + if (new == 0 && result != 0) + (void)__fe_mask_env (); + + if ((new & excepts) != 0) result = -1; return result; } |