aboutsummaryrefslogtreecommitdiff
path: root/ports
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2012-11-21 20:26:56 +0000
committerJoseph Myers <joseph@codesourcery.com>2012-11-21 20:26:56 +0000
commitad35f2dd750ed3e3f483409ef50b38ea19745002 (patch)
tree64d4f4be507055e344438505aee94c81c7ef3f81 /ports
parent09e958ed423b99f97f5fd4b101964dfc9e3b32c0 (diff)
downloadglibc-ad35f2dd750ed3e3f483409ef50b38ea19745002.zip
glibc-ad35f2dd750ed3e3f483409ef50b38ea19745002.tar.gz
glibc-ad35f2dd750ed3e3f483409ef50b38ea19745002.tar.bz2
Make ARM fesetenv (FE_NOMASK_ENV) detect failure (bug 14866).
Diffstat (limited to 'ports')
-rw-r--r--ports/ChangeLog.arm6
-rw-r--r--ports/sysdeps/arm/fesetenv.c10
2 files changed, 16 insertions, 0 deletions
diff --git a/ports/ChangeLog.arm b/ports/ChangeLog.arm
index d060121..2a56a9f 100644
--- a/ports/ChangeLog.arm
+++ b/ports/ChangeLog.arm
@@ -1,3 +1,9 @@
+2012-11-21 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #14866]
+ * sysdeps/arm/fesetenv.c (__fesetenv): Test whether bits for
+ trapping exceptions were successfully set for FE_NOMASK_ENV.
+
2012-11-14 Marcus Shawcroft <marcus.shawcroft@linaro.org>
* sysdeps/unix/sysv/linux/arm/Makefile (libcrypt-sysdep_routines): Add
diff --git a/ports/sysdeps/arm/fesetenv.c b/ports/sysdeps/arm/fesetenv.c
index 2fad61d..e92f9f5 100644
--- a/ports/sysdeps/arm/fesetenv.c
+++ b/ports/sysdeps/arm/fesetenv.c
@@ -40,6 +40,16 @@ __fesetenv (const fenv_t *envp)
_FPU_SETCW (temp);
+ if (envp == FE_NOMASK_ENV)
+ {
+ /* VFPv3 and VFPv4 do not support trapping exceptions, so
+ test whether the relevant bits were set and fail if
+ not. */
+ _FPU_GETCW (temp);
+ if ((temp & _FPU_IEEE) != _FPU_IEEE)
+ return 1;
+ }
+
/* Success. */
return 0;
}