about summary refs log tree commit diff
path: root/sysdeps/ieee754/ldbl-128
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2014-06-23 20:17:13 +0000
committerJoseph Myers <joseph@codesourcery.com>2014-06-23 20:17:13 +0000
commit46a3d3c7d60db15ea65470800bcba695f55ce6f6 (patch)
treecdd0d3a65570192d02256ef8c09baa0e0d347c5e /sysdeps/ieee754/ldbl-128
parent863893ec95f316a3d156d487b99242ee1b52f803 (diff)
downloadglibc-46a3d3c7d60db15ea65470800bcba695f55ce6f6.tar.gz
glibc-46a3d3c7d60db15ea65470800bcba695f55ce6f6.tar.xz
glibc-46a3d3c7d60db15ea65470800bcba695f55ce6f6.zip
Set errno for y1 overflow (bug 17050).
This patch fixes bug 17050, missing errno setting for y1 overflow (for
small positive arguments).  An appropriate check is added for overflow
directly in the __ieee754_y1 implementation, similar to the check
present for yn (doing it there rather than in the wrapper also avoids
yn needing to repeat the check when called for order 1 or -1 and it
uses __ieee754_y1).

Tested x86_64 and x86; no ulps update needed.  Also tested for mips64
to verify the ldbl-128 fix (the ldbl-128ibm code just #includes the
ldbl-128 file).

	[BZ #17050]
	* sysdeps/ieee754/dbl-64/e_j1.c: Include <errno.h>.
	(__ieee754_y1): Set errno if return value overflows.
	* sysdeps/ieee754/flt-32/e_j1f.c: Include <errno.h>.
	(__ieee754_y1f): Set errno if return value overflows.
	* sysdeps/ieee754/ldbl-128/e_j1l.c: Include <errno.h>.
	(__ieee754_y1l): Set errno if return value overflows.
	* sysdeps/ieee754/ldbl-96/e_j1l.c: Include <errno.h>.
	(__ieee754_y1l): Set errno if return value overflows.
	* math/auto-libm-test-in: Add more tests of y0, y1 and yn.
	* math/auto-libm-test-out: Regenerated.
Diffstat (limited to 'sysdeps/ieee754/ldbl-128')
-rw-r--r--sysdeps/ieee754/ldbl-128/e_j1l.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sysdeps/ieee754/ldbl-128/e_j1l.c b/sysdeps/ieee754/ldbl-128/e_j1l.c
index 1264c95d49..f24dfa9f8b 100644
--- a/sysdeps/ieee754/ldbl-128/e_j1l.c
+++ b/sysdeps/ieee754/ldbl-128/e_j1l.c
@@ -95,6 +95,7 @@
     License along with this library; if not, see
     <http://www.gnu.org/licenses/>.  */
 
+#include <errno.h>
 #include <math.h>
 #include <math_private.h>
 #include <float.h>
@@ -852,7 +853,12 @@ __ieee754_y1l (long double x)
     }
   xx = fabsl (x);
   if (xx <= 0x1p-114)
-    return -TWOOPI / x;
+    {
+      z = -TWOOPI / x;
+      if (__isinfl (z))
+	__set_errno (ERANGE);
+      return z;
+    }
   if (xx <= 2.0L)
     {
       /* 0 <= x <= 2 */