diff options
author | Szabolcs Nagy <szabolcs.nagy@arm.com> | 2016-11-16 17:27:04 +0000 |
---|---|---|
committer | Szabolcs Nagy <nsz@gcc.gnu.org> | 2016-11-16 17:27:04 +0000 |
commit | 0af30954688a9dc1fccdc7579807cb1f46b6ebd6 (patch) | |
tree | aea10529cc9a78a64ef9fc70e98fc3f892d3e7ba /gcc | |
parent | e38f65725b06aaf41ad62f023c26cfe8b99bb640 (diff) | |
download | gcc-0af30954688a9dc1fccdc7579807cb1f46b6ebd6.zip gcc-0af30954688a9dc1fccdc7579807cb1f46b6ebd6.tar.gz gcc-0af30954688a9dc1fccdc7579807cb1f46b6ebd6.tar.bz2 |
[PR libgfortran/78314] Fix ieee_support_halting
ieee_support_halting only checked the availability of status
flags, not trapping support. On some targets the later can
only be checked at runtime: feenableexcept reports if
enabling traps failed.
So check trapping support by enabling/disabling it.
Updated the test that enabled trapping to check if it is
supported.
gcc/testsuite/
PR libgfortran/78314
* gfortran.dg/ieee/ieee_6.f90: Use ieee_support_halting.
libgfortran/
PR libgfortran/78314
* config/fpu-glibc.h (support_fpu_trap): Use feenableexcept.
From-SVN: r242505
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/ieee/ieee_6.f90 | 9 |
2 files changed, 10 insertions, 4 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5ca2aaf..d750f25d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-11-16 Szabolcs Nagy <szabolcs.nagy@arm.com> + + PR libgfortran/78314 + * gfortran.dg/ieee/ieee_6.f90: Use ieee_support_halting. + 2016-11-16 Bin Cheng <bin.cheng@arm.com> * gcc.target/arm/ivopts-orig_biv-inc.c: Adjust test string diff --git a/gcc/testsuite/gfortran.dg/ieee/ieee_6.f90 b/gcc/testsuite/gfortran.dg/ieee/ieee_6.f90 index 8fb4f6f..43aa3bf 100644 --- a/gcc/testsuite/gfortran.dg/ieee/ieee_6.f90 +++ b/gcc/testsuite/gfortran.dg/ieee/ieee_6.f90 @@ -9,7 +9,7 @@ implicit none type(ieee_status_type) :: s1, s2 - logical :: flags(5), halt(5) + logical :: flags(5), halt(5), haltworks type(ieee_round_type) :: mode real :: x @@ -18,6 +18,7 @@ call ieee_set_flag(ieee_all, .false.) call ieee_set_rounding_mode(ieee_down) call ieee_set_halting_mode(ieee_all, .false.) + haltworks = ieee_support_halting(ieee_overflow) call ieee_get_status(s1) call ieee_set_status(s1) @@ -46,7 +47,7 @@ call ieee_get_rounding_mode(mode) if (mode /= ieee_to_zero) call abort call ieee_get_halting_mode(ieee_all, halt) - if ((.not. halt(1)) .or. any(halt(2:))) call abort + if ((haltworks .and. .not. halt(1)) .or. any(halt(2:))) call abort call ieee_set_status(s2) @@ -58,7 +59,7 @@ call ieee_get_rounding_mode(mode) if (mode /= ieee_to_zero) call abort call ieee_get_halting_mode(ieee_all, halt) - if ((.not. halt(1)) .or. any(halt(2:))) call abort + if ((haltworks .and. .not. halt(1)) .or. any(halt(2:))) call abort call ieee_set_status(s1) @@ -79,6 +80,6 @@ call ieee_get_rounding_mode(mode) if (mode /= ieee_to_zero) call abort call ieee_get_halting_mode(ieee_all, halt) - if ((.not. halt(1)) .or. any(halt(2:))) call abort + if ((haltworks .and. .not. halt(1)) .or. any(halt(2:))) call abort end |