This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.25-40-g4918e5f


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  4918e5f4cd63290bb0b2c614f52092ca6a779126 (commit)
      from  10303eb74bfe33d46ef167d2ea31c746ea1cd6ad (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=4918e5f4cd63290bb0b2c614f52092ca6a779126

commit 4918e5f4cd63290bb0b2c614f52092ca6a779126
Author: Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
Date:   Sun Feb 12 22:36:27 2017 -0200

    Fix y0 and y1 exception handling for zero input [BZ #21134]
    
    The Bessel functions of the second type (Yn) should raise the "divide
    by zero" exception when input is zero (both positive and negative).
    Current code gives the right output, but fails to set the exception.
    This error is exposed for float, double, and long double when linking
    with -lieee.  Without this flag, the error is not exposed, because the
    wrappers for these functions, which use __kernel_standard
    functionality, set the exception as expected.
    
    Tested for powerpc64le.
    
    	[BZ #21134]
    	* sysdeps/ieee754/dbl-64/e_j0.c (__ieee754_y0): Raise the
    	"divide by zero" exception when the input is zero.
    	* sysdeps/ieee754/dbl-64/e_j1.c (__ieee754_y1): Likewise.
    	* sysdeps/ieee754/flt-32/e_j0f.c (__ieee754_y0f): Likewise.
    	* sysdeps/ieee754/flt-32/e_j1f.c (__ieee754_y1f): Likewise.
    	* sysdeps/ieee754/ldbl-128/e_j0l.c (__ieee754_y0l): Likewise.
    	* sysdeps/ieee754/ldbl-128/e_j1l.c (__ieee754_y1l): Likewise.

diff --git a/ChangeLog b/ChangeLog
index b040928..62961a2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2017-02-15  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
+
+	[BZ #21134]
+	* sysdeps/ieee754/dbl-64/e_j0.c (__ieee754_y0): Raise the
+	"divide by zero" exception when the input is zero.
+	* sysdeps/ieee754/dbl-64/e_j1.c (__ieee754_y1): Likewise.
+	* sysdeps/ieee754/flt-32/e_j0f.c (__ieee754_y0f): Likewise.
+	* sysdeps/ieee754/flt-32/e_j1f.c (__ieee754_y1f): Likewise.
+	* sysdeps/ieee754/ldbl-128/e_j0l.c (__ieee754_y0l): Likewise.
+	* sysdeps/ieee754/ldbl-128/e_j1l.c (__ieee754_y1l): Likewise.
+
 2017-02-15  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/x86_64/fpu/test-double-vlen2.c: Move most contents to,
diff --git a/sysdeps/ieee754/dbl-64/e_j0.c b/sysdeps/ieee754/dbl-64/e_j0.c
index 9f25aa8..4b440cf 100644
--- a/sysdeps/ieee754/dbl-64/e_j0.c
+++ b/sysdeps/ieee754/dbl-64/e_j0.c
@@ -169,7 +169,7 @@ __ieee754_y0 (double x)
   if (ix >= 0x7ff00000)
     return one / (x + x * x);
   if ((ix | lx) == 0)
-    return -HUGE_VAL + x;                  /* -inf and overflow exception.  */
+    return -1 / zero; /* -inf and divide by zero exception.  */
   if (hx < 0)
     return zero / (zero * x);
   if (ix >= 0x40000000)         /* |x| >= 2.0 */
diff --git a/sysdeps/ieee754/dbl-64/e_j1.c b/sysdeps/ieee754/dbl-64/e_j1.c
index 4827fbf..eb446fd 100644
--- a/sysdeps/ieee754/dbl-64/e_j1.c
+++ b/sysdeps/ieee754/dbl-64/e_j1.c
@@ -174,7 +174,7 @@ __ieee754_y1 (double x)
   if (__glibc_unlikely (ix >= 0x7ff00000))
     return one / (x + x * x);
   if (__glibc_unlikely ((ix | lx) == 0))
-    return -HUGE_VAL + x;
+    return -1 / zero; /* -inf and divide by zero exception.  */
   /* -inf and overflow exception.  */;
   if (__glibc_unlikely (hx < 0))
     return zero / (zero * x);
diff --git a/sysdeps/ieee754/flt-32/e_j0f.c b/sysdeps/ieee754/flt-32/e_j0f.c
index bd0b80f..b783dd0 100644
--- a/sysdeps/ieee754/flt-32/e_j0f.c
+++ b/sysdeps/ieee754/flt-32/e_j0f.c
@@ -105,7 +105,7 @@ __ieee754_y0f(float x)
 	ix = 0x7fffffff&hx;
     /* Y0(NaN) is NaN, y0(-inf) is Nan, y0(inf) is 0, y0(0) is -inf.  */
 	if(ix>=0x7f800000) return  one/(x+x*x);
-	if(ix==0) return -HUGE_VALF+x;  /* -inf and overflow exception.  */
+	if(ix==0) return -1/zero; /* -inf and divide by zero exception.  */
 	if(hx<0) return zero/(zero*x);
 	if(ix >= 0x40000000) {  /* |x| >= 2.0 */
 	/* y0(x) = sqrt(2/(pi*x))*(p0(x)*sin(x0)+q0(x)*cos(x0))
diff --git a/sysdeps/ieee754/flt-32/e_j1f.c b/sysdeps/ieee754/flt-32/e_j1f.c
index f359a3d..805a87d 100644
--- a/sysdeps/ieee754/flt-32/e_j1f.c
+++ b/sysdeps/ieee754/flt-32/e_j1f.c
@@ -112,7 +112,7 @@ __ieee754_y1f(float x)
     /* if Y1(NaN) is NaN, Y1(-inf) is NaN, Y1(inf) is 0 */
 	if(__builtin_expect(ix>=0x7f800000, 0)) return  one/(x+x*x);
 	if(__builtin_expect(ix==0, 0))
-		return -HUGE_VALF+x;  /* -inf and overflow exception.  */
+		return -1/zero; /* -inf and divide by zero exception.  */
 	if(__builtin_expect(hx<0, 0)) return zero/(zero*x);
 	if(ix >= 0x40000000) {  /* |x| >= 2.0 */
 		SET_RESTORE_ROUNDF (FE_TONEAREST);
diff --git a/sysdeps/ieee754/ldbl-128/e_j0l.c b/sysdeps/ieee754/ldbl-128/e_j0l.c
index 855b5a5..fb8d351 100644
--- a/sysdeps/ieee754/ldbl-128/e_j0l.c
+++ b/sysdeps/ieee754/ldbl-128/e_j0l.c
@@ -834,7 +834,7 @@ _Float128
     {
       if (x < 0)
 	return (zero / (zero * x));
-      return -HUGE_VALL + x;
+      return -1 / zero; /* -inf and divide by zero exception.  */
     }
   xx = fabsl (x);
   if (xx <= 0x1p-57)
diff --git a/sysdeps/ieee754/ldbl-128/e_j1l.c b/sysdeps/ieee754/ldbl-128/e_j1l.c
index db8dca0..6fc69fa 100644
--- a/sysdeps/ieee754/ldbl-128/e_j1l.c
+++ b/sysdeps/ieee754/ldbl-128/e_j1l.c
@@ -852,7 +852,7 @@ __ieee754_y1l (_Float128 x)
     {
       if (x < 0)
 	return (zero / (zero * x));
-      return -HUGE_VALL + x;
+      return -1 / zero; /* -inf and divide by zero exception.  */
     }
   xx = fabsl (x);
   if (xx <= 0x1p-114)

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                        |   11 +++++++++++
 sysdeps/ieee754/dbl-64/e_j0.c    |    2 +-
 sysdeps/ieee754/dbl-64/e_j1.c    |    2 +-
 sysdeps/ieee754/flt-32/e_j0f.c   |    2 +-
 sysdeps/ieee754/flt-32/e_j1f.c   |    2 +-
 sysdeps/ieee754/ldbl-128/e_j0l.c |    2 +-
 sysdeps/ieee754/ldbl-128/e_j1l.c |    2 +-
 7 files changed, 17 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]