]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Avoid ordered comparisons of NaNs in ldbl-128ibm acosl and asinl.
authorJoseph Myers <joseph@codesourcery.com>
Thu, 10 Oct 2013 19:11:30 +0000 (19:11 +0000)
committerAdhemerval Zanella <azanella@linux.vnet.ibm.com>
Thu, 31 Oct 2013 15:44:39 +0000 (10:44 -0500)
ChangeLog
sysdeps/ieee754/ldbl-128ibm/e_acosl.c
sysdeps/ieee754/ldbl-128ibm/e_asinl.c

index 28960dc4a41eaabd87acf973ea789dd947ce05a0..3805278d9398c12882ec04020e35fa30138fcec0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2013-10-10  Joseph Myers  <joseph@codsourcery.com>
+
+       * sysdeps/ieee754/ldbl-128ibm/e_acosl.c (__ieee754_acosl): Check
+       for NaNs before doing comparisons on argument.
+       * sysdeps/ieee754/ldbl-128ibm/e_asinl.c (__ieee754_asinl):
+       Likewise.
+
 2013-10-04  Anton Blanchard <anton@au1.ibm.com>
            Alistair Popple <alistair@ozlabs.au.ibm.com>
            Alan Modra <amodra@gmail.com>
index 5d2af30346b446434473c6ad4af97725802ae9ed..4b612815f86322e0c56108b060abce216bc557f6 100644 (file)
@@ -151,11 +151,13 @@ static const long double
 long double
 __ieee754_acosl (long double x)
 {
-  long double z, r, w, p, q, s, t, f2;
+  long double a, z, r, w, p, q, s, t, f2;
   ieee854_long_double_shape_type u;
 
-  u.value = __builtin_fabsl (x);
-  if (u.value == 1.0L)
+  if (__glibc_unlikely (__isnanl (x)))
+    return x + x;
+  a = __builtin_fabsl (x);
+  if (a == 1.0L)
     {
       if (x > 0.0L)
        return 0.0;             /* acos(1) = 0  */
index b395439495e0c769fb3b55ee284c100ea894b2ae..bb69402fbc1db17aa3b9e08f0943eb8452fc2403 100644 (file)
@@ -135,6 +135,8 @@ __ieee754_asinl (long double x)
   int flag;
   ieee854_long_double_shape_type u;
 
+  if (__glibc_unlikely (__isnanl (x)))
+    return x + x;
   flag = 0;
   u.value = __builtin_fabsl (x);
   if (u.value == 1.0L) /* |x|>= 1 */