diff options
author | Joseph Myers <joseph@codesourcery.com> | 2014-09-18 13:00:21 +0100 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2014-09-18 13:00:21 +0100 |
commit | e770bfd997bb5803b88ca4081bdbca3e250fc92e (patch) | |
tree | f8eda81754a6c8acd78502eec0b4a7e3ff0fcef7 /libgcc | |
parent | b5a260238027e86912c39df2147e345ca8a6ed26 (diff) | |
download | gcc-e770bfd997bb5803b88ca4081bdbca3e250fc92e.zip gcc-e770bfd997bb5803b88ca4081bdbca3e250fc92e.tar.gz gcc-e770bfd997bb5803b88ca4081bdbca3e250fc92e.tar.bz2 |
Fix i386 FP_TRAPPING_EXCEPTIONS.
The i386 sfp-machine.h defines FP_TRAPPING_EXCEPTIONS in a way that is
always wrong: it treats a set bit as indicating the exception is
trapping, when actually a set bit (both for 387 and SSE floating
point) indicates it is masked, and a clear bit indicates it is
trapping. This patch fixes this bug.
Bootstrapped with no regressions on x86_64-unknown-linux-gnu.
libgcc:
* config/i386/sfp-machine.h (FP_TRAPPING_EXCEPTIONS): Treat clear
bits not set bits as indicating trapping exceptions.
gcc/testsuite:
* gcc.dg/torture/float128-exact-underflow.c: New test.
From-SVN: r215347
Diffstat (limited to 'libgcc')
-rw-r--r-- | libgcc/ChangeLog | 5 | ||||
-rw-r--r-- | libgcc/config/i386/sfp-machine.h | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 6c6e386..fa432395 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,8 @@ +2014-09-18 Joseph Myers <joseph@codesourcery.com> + + * config/i386/sfp-machine.h (FP_TRAPPING_EXCEPTIONS): Treat clear + bits not set bits as indicating trapping exceptions. + 2014-09-17 Nathan sidwell <nathan@acm.org> * Makefile.in (LIBGCOV_INTERFACE): Add _gcov_dump from ... diff --git a/libgcc/config/i386/sfp-machine.h b/libgcc/config/i386/sfp-machine.h index 148044a..8a1923b 100644 --- a/libgcc/config/i386/sfp-machine.h +++ b/libgcc/config/i386/sfp-machine.h @@ -60,7 +60,7 @@ void __sfp_handle_exceptions (int); __sfp_handle_exceptions (_fex); \ } while (0); -#define FP_TRAPPING_EXCEPTIONS ((_fcw >> FP_EX_SHIFT) & FP_EX_ALL) +#define FP_TRAPPING_EXCEPTIONS ((~_fcw >> FP_EX_SHIFT) & FP_EX_ALL) #define FP_ROUNDMODE (_fcw & FP_RND_MASK) #endif |