]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR fortran/88678
authoruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 30 Jan 2019 20:44:35 +0000 (20:44 +0000)
committeruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 30 Jan 2019 20:44:35 +0000 (20:44 +0000)
* config/fpu-glibc.h (support_fpu_trap): Do not try to enable
exceptions to determine if exception is supported.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@268402 138bc75d-0d04-0410-961f-82ee72b054a4

libgfortran/ChangeLog
libgfortran/config/fpu-glibc.h

index 87fc2d6a38caa0b904b35bfa7753ebcd197ff591..3cf16a57c7e17487457db07286e0b163e238cae8 100644 (file)
@@ -1,3 +1,9 @@
+2019-01-30  Uroš Bizjak  <ubizjak@gmail.com>
+
+       PR fortran/88678
+       * config/fpu-glibc.h (support_fpu_trap): Do not try to enable
+       exceptions to determine if exception is supported.
+
 2019-01-30  Uroš Bizjak  <ubizjak@gmail.com>
 
        PR fortran/88678
index 9abdfd95ee3bd62fd6f245e035b7a8b8e09bdf47..df2588e038d879041b66f09efb6e906a9359d28d 100644 (file)
@@ -129,41 +129,7 @@ get_fpu_trap_exceptions (void)
 int
 support_fpu_trap (int flag)
 {
-  int exceptions = 0;
-  int old;
-
-  if (!support_fpu_flag (flag))
-    return 0;
-
-#ifdef FE_INVALID
-  if (flag & GFC_FPE_INVALID) exceptions |= FE_INVALID;
-#endif
-
-#ifdef FE_DIVBYZERO
-  if (flag & GFC_FPE_ZERO) exceptions |= FE_DIVBYZERO;
-#endif
-
-#ifdef FE_OVERFLOW
-  if (flag & GFC_FPE_OVERFLOW) exceptions |= FE_OVERFLOW;
-#endif
-
-#ifdef FE_UNDERFLOW
-  if (flag & GFC_FPE_UNDERFLOW) exceptions |= FE_UNDERFLOW;
-#endif
-
-#ifdef FE_DENORMAL
-  if (flag & GFC_FPE_DENORMAL) exceptions |= FE_DENORMAL;
-#endif
-
-#ifdef FE_INEXACT
-  if (flag & GFC_FPE_INEXACT) exceptions |= FE_INEXACT;
-#endif
-
-  old = feenableexcept (exceptions);
-  if (old == -1)
-    return 0;
-  fedisableexcept (exceptions & ~old);
-  return 1;
+  return support_fpu_flag (flag);
 }