Commit 05dfdd6c by Uros Bizjak Committed by Uros Bizjak

re PR fortran/88678 (Many gfortran.dg/ieee/ieee_X.f90 test cases fail starting with r267465)

	PR fortran/88678
	* config/fpu-glibc.h (support_fpu_trap): Do not try to enable
	exceptions to determine if exception is supported.

From-SVN: r268402
parent 9f4e09a8
2019-01-30 Uroš Bizjak <ubizjak@gmail.com> 2019-01-30 Uroš Bizjak <ubizjak@gmail.com>
PR fortran/88678 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
* config/fpu-glibc.h (set_fpu_trap_exceptions): Clear stalled * config/fpu-glibc.h (set_fpu_trap_exceptions): Clear stalled
exception flags before changing trap mode. Optimize to call exception flags before changing trap mode. Optimize to call
feenableexcept and fedisableexcept only once. feenableexcept and fedisableexcept only once.
......
...@@ -129,41 +129,7 @@ get_fpu_trap_exceptions (void) ...@@ -129,41 +129,7 @@ get_fpu_trap_exceptions (void)
int int
support_fpu_trap (int flag) support_fpu_trap (int flag)
{ {
int exceptions = 0; return support_fpu_flag (flag);
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;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment