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.26-510-g86c27ad


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  86c27ade1e44e29922d33676f950f7334edb37a7 (commit)
       via  8f8f8ef7aba40ef883291e4c4d95a419c3327d70 (commit)
      from  955774751b71c4bc94029dd541ad9d34634ec995 (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=86c27ade1e44e29922d33676f950f7334edb37a7

commit 86c27ade1e44e29922d33676f950f7334edb37a7
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Tue Oct 3 18:12:42 2017 +0100

    [BZ #22244] Fix yn(n,0) without SVID wrapper
    
    Without SVID compat wrapper yn(n,0) and ynf(n,0) does not raise
    the divide-by-zero excpetion and it may return inf with the wrong
    sign for n < 0.
    
    	[BZ #22244]
    	* sysdeps/ieee754/dbl-64/e_jn.c (__ieee754_yn): Fix x == 0 case.
    	* sysdeps/ieee754/flt-32/e_jnf.c (__ieee754_ynf): Likewise.

diff --git a/ChangeLog b/ChangeLog
index 6161509..55295ba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2017-10-04  Szabolcs Nagy  <szabolcs.nagy@arm.com>
 
+	[BZ #22244]
+	* sysdeps/ieee754/dbl-64/e_jn.c (__ieee754_yn): Fix x == 0 case.
+	* sysdeps/ieee754/flt-32/e_jnf.c (__ieee754_ynf): Likewise.
+
+2017-10-04  Szabolcs Nagy  <szabolcs.nagy@arm.com>
+
 	[BZ #22243]
 	* sysdeps/ieee754/dbl-64/wordsize-64/e_log10.c (__ieee754_log10): Use fabs.
 	* sysdeps/ieee754/dbl-64/wordsize-64/e_log2.c (__ieee754_log2): Likewise.
diff --git a/sysdeps/ieee754/dbl-64/e_jn.c b/sysdeps/ieee754/dbl-64/e_jn.c
index 3ac91df..a244df0 100644
--- a/sysdeps/ieee754/dbl-64/e_jn.c
+++ b/sysdeps/ieee754/dbl-64/e_jn.c
@@ -268,11 +268,6 @@ __ieee754_yn (int n, double x)
   /* if Y(n,NaN) is NaN */
   if (__glibc_unlikely ((ix | ((uint32_t) (lx | -lx)) >> 31) > 0x7ff00000))
     return x + x;
-  if (__glibc_unlikely ((ix | lx) == 0))
-    return -HUGE_VAL + x;
-  /* -inf and overflow exception.  */;
-  if (__glibc_unlikely (hx < 0))
-    return zero / (zero * x);
   sign = 1;
   if (n < 0)
     {
@@ -281,6 +276,11 @@ __ieee754_yn (int n, double x)
     }
   if (n == 0)
     return (__ieee754_y0 (x));
+  if (__glibc_unlikely ((ix | lx) == 0))
+    return -sign / zero;
+  /* -inf and overflow exception.  */;
+  if (__glibc_unlikely (hx < 0))
+    return zero / (zero * x);
   {
     SET_RESTORE_ROUND (FE_TONEAREST);
     if (n == 1)
diff --git a/sysdeps/ieee754/flt-32/e_jnf.c b/sysdeps/ieee754/flt-32/e_jnf.c
index 82b9ba3..4b78ece 100644
--- a/sysdeps/ieee754/flt-32/e_jnf.c
+++ b/sysdeps/ieee754/flt-32/e_jnf.c
@@ -194,15 +194,15 @@ __ieee754_ynf(int n, float x)
 	ix = 0x7fffffff&hx;
     /* if Y(n,NaN) is NaN */
 	if(__builtin_expect(ix>0x7f800000, 0)) return x+x;
-	if(__builtin_expect(ix==0, 0))
-		return -HUGE_VALF+x;  /* -inf and overflow exception.  */
-	if(__builtin_expect(hx<0, 0)) return zero/(zero*x);
 	sign = 1;
 	if(n<0){
 		n = -n;
 		sign = 1 - ((n&1)<<1);
 	}
 	if(n==0) return(__ieee754_y0f(x));
+	if(__builtin_expect(ix==0, 0))
+		return -sign/zero;
+	if(__builtin_expect(hx<0, 0)) return zero/(zero*x);
 	SET_RESTORE_ROUNDF (FE_TONEAREST);
 	if(n==1) {
 	    ret = sign*__ieee754_y1f(x);

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=8f8f8ef7aba40ef883291e4c4d95a419c3327d70

commit 8f8f8ef7aba40ef883291e4c4d95a419c3327d70
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Tue Oct 3 17:13:18 2017 +0100

    [BZ #22243] fix log2(0) and log(10) in downward rounding
    
    On 64bit targets if the SVID compat wrapper is suppressed (e.g. static linking)
    then log2(0) and log10(0) returned inf instead of -inf.
    
    	[BZ #22243]
    	* sysdeps/ieee754/dbl-64/wordsize-64/e_log10.c (__ieee754_log10): Use fabs.
    	* sysdeps/ieee754/dbl-64/wordsize-64/e_log2.c (__ieee754_log2): Likewise.

diff --git a/ChangeLog b/ChangeLog
index a8d731c..6161509 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-10-04  Szabolcs Nagy  <szabolcs.nagy@arm.com>
+
+	[BZ #22243]
+	* sysdeps/ieee754/dbl-64/wordsize-64/e_log10.c (__ieee754_log10): Use fabs.
+	* sysdeps/ieee754/dbl-64/wordsize-64/e_log2.c (__ieee754_log2): Likewise.
+
 2017-10-03  H.J. Lu  <hongjiu.lu@intel.com>
 
 	* sysdeps/i386/start.S: Replace "leal main@GOT(%ebx), %eax" with
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/e_log10.c b/sysdeps/ieee754/dbl-64/wordsize-64/e_log10.c
index 4f5a816..cd55671 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/e_log10.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/e_log10.c
@@ -65,7 +65,7 @@ __ieee754_log10 (double x)
   if (hx < INT64_C(0x0010000000000000))
     {				/* x < 2**-1022  */
       if (__glibc_unlikely ((hx & UINT64_C(0x7fffffffffffffff)) == 0))
-	return -two54 / (x - x);	/* log(+-0)=-inf */
+	return -two54 / fabs (x);	/* log(+-0)=-inf */
       if (__glibc_unlikely (hx < 0))
 	return (x - x) / (x - x);	/* log(-#) = NaN */
       k -= 54;
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/e_log2.c b/sysdeps/ieee754/dbl-64/wordsize-64/e_log2.c
index 5ccb78c..f08d5b3 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/e_log2.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/e_log2.c
@@ -81,7 +81,7 @@ __ieee754_log2 (double x)
   if (hx < INT64_C(0x0010000000000000))
     {				/* x < 2**-1022  */
       if (__glibc_unlikely ((hx & UINT64_C(0x7fffffffffffffff)) == 0))
-	return -two54 / (x - x);	/* log(+-0)=-inf */
+	return -two54 / fabs (x);	/* log(+-0)=-inf */
       if (__glibc_unlikely (hx < 0))
 	return (x - x) / (x - x);	/* log(-#) = NaN */
       k -= 54;

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

Summary of changes:
 ChangeLog                                    |   12 ++++++++++++
 sysdeps/ieee754/dbl-64/e_jn.c                |   10 +++++-----
 sysdeps/ieee754/dbl-64/wordsize-64/e_log10.c |    2 +-
 sysdeps/ieee754/dbl-64/wordsize-64/e_log2.c  |    2 +-
 sysdeps/ieee754/flt-32/e_jnf.c               |    6 +++---
 5 files changed, 22 insertions(+), 10 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]