]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Clean up ldbl-128 / ldbl-128ibm expm1l dead code (bug 16415).
authorJoseph Myers <joseph@codesourcery.com>
Wed, 16 Sep 2015 16:42:46 +0000 (16:42 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Wed, 16 Sep 2015 16:42:46 +0000 (16:42 +0000)
The ldbl-128 and ldbl-128ibm expm1l implementations have code to
handle +Inf and finite arguments above an overflow threshold.  Since
they now use __expl for large positive arguments to fix other
problems, this code is unreachable; this patch removes it.

Tested for mips64 and powerpc.

[BZ #16415]
* sysdeps/ieee754/ldbl-128/s_expm1l.c (maxlog): Remove variable.
(__expm1l): Remove code to handle positive infinity and overflow.
* sysdeps/ieee754/ldbl-128ibm/s_expm1l.c (maxlog): Remove
variable.
(__expm1l): Remove code to handle positive infinity and overflow.

ChangeLog
NEWS
sysdeps/ieee754/ldbl-128/s_expm1l.c
sysdeps/ieee754/ldbl-128ibm/s_expm1l.c

index df355abe92a639c0f5a89cc3c9ed993ffc74f56e..0a2e5799c4e24e8fc15b9c1b4fbe90041d299213 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2015-09-16  Joseph Myers  <joseph@codesourcery.com>
+
+       [BZ #16415]
+       * sysdeps/ieee754/ldbl-128/s_expm1l.c (maxlog): Remove variable.
+       (__expm1l): Remove code to handle positive infinity and overflow.
+       * sysdeps/ieee754/ldbl-128ibm/s_expm1l.c (maxlog): Remove
+       variable.
+       (__expm1l): Remove code to handle positive infinity and overflow.
+
 2015-09-16  Paul Eggert  <eggert@cs.ucla.edu>
            Paul Pluzhnikov  <ppluzhnikov@google.com>
 
diff --git a/NEWS b/NEWS
index d46717e47a6c09bca8f25a2dbbae656a6b25f5b3..0e9353f6792fed1284aba3cbf970bb28326c19e6 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -9,12 +9,12 @@ Version 2.23
 
 * The following bugs are resolved with this release:
 
-  2542, 2543, 2558, 2898, 14341, 14912, 15786, 15918, 16141, 16296, 16517,
-  16519, 16520, 16521, 16734, 16973, 16985, 17243, 17244, 17787, 17905,
-  18084, 18086, 18240, 18265, 18370, 18421, 18480, 18525, 18595, 18610,
-  18618, 18647, 18661, 18674, 18675, 18681, 18757, 18778, 18781, 18787,
-  18789, 18790, 18795, 18796, 18820, 18823, 18824, 18857, 18863, 18870,
-  18872, 18873, 18875, 18887, 18921, 18952, 18961, 18966, 18967.
+  2542, 2543, 2558, 2898, 14341, 14912, 15786, 15918, 16141, 16296, 16415,
+  16517, 16519, 16520, 16521, 16734, 16973, 16985, 17243, 17244, 17787,
+  17905, 18084, 18086, 18240, 18265, 18370, 18421, 18480, 18525, 18595,
+  18610, 18618, 18647, 18661, 18674, 18675, 18681, 18757, 18778, 18781,
+  18787, 18789, 18790, 18795, 18796, 18820, 18823, 18824, 18857, 18863,
+  18870, 18872, 18873, 18875, 18887, 18921, 18952, 18961, 18966, 18967.
 
 * The obsolete header <regexp.h> has been removed.  Programs that require
   this header must be updated to use <regex.h> instead.
index 573d00be57274a53ee6c2873afdd55458fff0a34..f1a68c878b792636dde6166bd84f795a22ea8fe2 100644 (file)
@@ -84,8 +84,6 @@ static const long double
 
   C1 = 6.93145751953125E-1L,
   C2 = 1.428606820309417232121458176568075500134E-6L,
-/* ln (2^16384 * (1 - 2^-113)) */
-  maxlog = 1.1356523406294143949491931077970764891253E4L,
 /* ln 2^-114 */
   minarg = -7.9018778583833765273564461846232128760607E1L, big = 1e4932L;
 
@@ -110,14 +108,9 @@ __expm1l (long double x)
     }
   if (ix >= 0x7fff0000)
     {
-      /* Infinity. */
+      /* Infinity (which must be negative infinity). */
       if (((ix & 0xffff) | u.parts32.w1 | u.parts32.w2 | u.parts32.w3) == 0)
-       {
-         if (sign)
-           return -1.0L;
-         else
-           return x;
-       }
+       return -1.0L;
       /* NaN. No invalid exception. */
       return x;
     }
@@ -126,13 +119,6 @@ __expm1l (long double x)
   if ((ix == 0) && (u.parts32.w1 | u.parts32.w2 | u.parts32.w3) == 0)
     return x;
 
-  /* Overflow.  */
-  if (x > maxlog)
-    {
-      __set_errno (ERANGE);
-      return (big * big);
-    }
-
   /* Minimum value.  */
   if (x < minarg)
     return (4.0/big - 1.0L);
index 0464f79043e1793b62bee087f94c26d2359ab6f1..66f75e1c80323e20194e18d2d1543606fdf61414 100644 (file)
@@ -82,8 +82,6 @@ static const long double
 
   C1 = 6.93145751953125E-1L,
   C2 = 1.428606820309417232121458176568075500134E-6L,
-/* ln (2^16384 * (1 - 2^-113)) */
-  maxlog = 1.1356523406294143949491931077970764891253E4L,
 /* ln 2^-114 */
   minarg = -7.9018778583833765273564461846232128760607E1L, big = 1e290L;
 
@@ -105,14 +103,9 @@ __expm1l (long double x)
     return __expl (x);
   if (ix >= 0x7ff00000)
     {
-      /* Infinity. */
+      /* Infinity (which must be negative infinity). */
       if (((ix - 0x7ff00000) | lx) == 0)
-       {
-         if (sign)
-           return -1.0L;
-         else
-           return x;
-       }
+       return -1.0L;
       /* NaN. No invalid exception. */
       return x;
     }
@@ -121,13 +114,6 @@ __expm1l (long double x)
   if ((ix | lx) == 0)
     return x;
 
-  /* Overflow.  */
-  if (x > maxlog)
-    {
-      __set_errno (ERANGE);
-      return (big * big);
-    }
-
   /* Minimum value.  */
   if (x < minarg)
     return (4.0/big - 1.0L);