about summary refs log tree commit diff
path: root/ports
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2013-06-17 17:20:23 +0000
committerJoseph Myers <joseph@codesourcery.com>2013-06-17 17:20:23 +0000
commit3023a72eb83751a23b01b6cb996fb81fe3abbcb6 (patch)
tree9dc05fe06ed6a8dd31c1809666bc0f568ea5fdab /ports
parent12086fb4835639d1762622d80980a7500799b63e (diff)
downloadglibc-3023a72eb83751a23b01b6cb996fb81fe3abbcb6.tar.gz
glibc-3023a72eb83751a23b01b6cb996fb81fe3abbcb6.tar.xz
glibc-3023a72eb83751a23b01b6cb996fb81fe3abbcb6.zip
Make ARM feenableexcept detect failure (bug 14907).
Diffstat (limited to 'ports')
-rw-r--r--ports/ChangeLog.arm6
-rw-r--r--ports/sysdeps/arm/feenablxcpt.c12
2 files changed, 18 insertions, 0 deletions
diff --git a/ports/ChangeLog.arm b/ports/ChangeLog.arm
index 81792d2aa4..00f37892cd 100644
--- a/ports/ChangeLog.arm
+++ b/ports/ChangeLog.arm
@@ -1,3 +1,9 @@
+2013-06-17  Joseph Myers  <joseph@codesourcery.com>
+
+	[BZ #14907]
+	* sysdeps/arm/feenablxcpt.c (feenableexcept): Test whether all
+	requested exception traps were enabled and return -1 if not.
+
 2013-06-15  Siddhesh Poyarekar  <siddhesh@redhat.com>
 
 	* sysdeps/unix/sysv/linux/arm/nptl/libpthread.abilist: Update.
diff --git a/ports/sysdeps/arm/feenablxcpt.c b/ports/sysdeps/arm/feenablxcpt.c
index baad4320cc..e2e287b6e5 100644
--- a/ports/sysdeps/arm/feenablxcpt.c
+++ b/ports/sysdeps/arm/feenablxcpt.c
@@ -39,6 +39,18 @@ feenableexcept (int excepts)
 
       _FPU_SETCW(new_exc);
 
+      if (excepts != 0)
+	{
+	  /* VFPv3 and VFPv4 do not support trapping exceptions, so
+	     test whether the relevant bits were set and fail if
+	     not.  */
+	  unsigned int temp;
+	  _FPU_GETCW (temp);
+	  if ((temp & (excepts << FE_EXCEPT_SHIFT))
+	      != (excepts << FE_EXCEPT_SHIFT))
+	    return -1;
+	}
+
       return old_exc;
     }