Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/mingw/mingwex/feholdexcept.c')
-rw-r--r--winsup/mingw/mingwex/feholdexcept.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/winsup/mingw/mingwex/feholdexcept.c b/winsup/mingw/mingwex/feholdexcept.c
index df486afb3..8d4a3f67b 100644
--- a/winsup/mingw/mingwex/feholdexcept.c
+++ b/winsup/mingw/mingwex/feholdexcept.c
@@ -8,11 +8,9 @@
int feholdexcept (fenv_t * envp)
{
- fenv_t tmp_env;
__asm__ ("fnstenv %0;" : "=m" (* envp)); /* save current into envp */
- tmp_env = * envp;
- tmp_env.__status_word &= ~FE_ALL_EXCEPT; /* clear exception flags */
- tmp_env.__control_word |= FE_ALL_EXCEPT; /* set cw to non-stop */
- __asm__ volatile ("fldenv %0;" : : "m" (tmp_env)); /* install the copy */
+ /* fnstenv sets control word to non-stop for all exceptions, so all we
+ need to do is clear the exception flags. */
+ __asm__ ("fnclex");
return 0;
}