GNU C Library master sources branch master updated. glibc-2.24-264-g4d5940f

jsm28@sourceware.org jsm28@sourceware.org
Tue Oct 11 00:51:00 GMT 2016


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  4d5940f0151241b73c6c0c1eb290462eb9c279b0 (commit)
      from  352db0bd059df1ad2da5d22e6ea3fd3e4f2ce236 (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=4d5940f0151241b73c6c0c1eb290462eb9c279b0

commit 4d5940f0151241b73c6c0c1eb290462eb9c279b0
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Tue Oct 11 00:50:43 2016 +0000

    Avoid M_NAN + M_NAN in complex functions.
    
    Some libm complex functions have code that computes M_NAN + M_NAN.
    This is nonsensical; it's just equivalent to M_NAN, since it's a quiet
    NaN (and the comments suggesting this raises an exception are
    similarly wrong).  This patch changes the code just to use M_NAN (and
    removes the bogus comments).  (Preferably, code should either
    propagate an input NaN or do a computation that raises "invalid" and
    generates a default NaN at the same time.  There are various cases,
    however, that currently raise "invalid" even for NaN inputs; I think
    those are cases where "invalid" is optional in ISO C so a change to
    whether it's raised would be OK, but they would still need more
    careful consideration than the cases where such issues do not arise.)
    
    Tested for x86_64 and x86 (testsuite, and that installed stripped
    shared libraries are unchanged by the patch).
    
    	* math/s_ccosh_template.c (M_DECL_FUNC (__ccosh)): Use M_NAN
    	instead of M_NAN + M_NAN.
    	* math/s_csinh_template.c (M_DECL_FUNC (__csinh)): Likewise.

diff --git a/ChangeLog b/ChangeLog
index 2590895..ee5f315 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2016-10-11  Joseph Myers  <joseph@codesourcery.com>
+
+	* math/s_ccosh_template.c (M_DECL_FUNC (__ccosh)): Use M_NAN
+	instead of M_NAN + M_NAN.
+	* math/s_csinh_template.c (M_DECL_FUNC (__csinh)): Likewise.
+
 2016-10-10  Samuel Thibault  <samuel.thibault@ens-lyon.org>
 
 	* misc/getauxval.c [!HAVE_AUX_VECTOR] (__getauxval): Do not define
diff --git a/math/s_ccosh_template.c b/math/s_ccosh_template.c
index 68de41d..7fea5c9 100644
--- a/math/s_ccosh_template.c
+++ b/math/s_ccosh_template.c
@@ -88,7 +88,7 @@ M_DECL_FUNC (__ccosh) (CFLOAT x)
       else
 	{
 	  __imag__ retval = __real__ x == 0 ? 0 : M_NAN;
-	  __real__ retval = M_NAN + M_NAN;
+	  __real__ retval = M_NAN;
 
 	  if (icls == FP_INFINITE)
 	    feraiseexcept (FE_INVALID);
@@ -124,9 +124,8 @@ M_DECL_FUNC (__ccosh) (CFLOAT x)
 	}
       else
 	{
-	  /* The addition raises the invalid exception.  */
 	  __real__ retval = M_HUGE_VAL;
-	  __imag__ retval = M_NAN + M_NAN;
+	  __imag__ retval = M_NAN;
 
 	  if (icls == FP_INFINITE)
 	    feraiseexcept (FE_INVALID);
diff --git a/math/s_csinh_template.c b/math/s_csinh_template.c
index 22c0c31..45fbb36 100644
--- a/math/s_csinh_template.c
+++ b/math/s_csinh_template.c
@@ -97,7 +97,7 @@ M_DECL_FUNC (__csinh) (CFLOAT x)
 	    {
 	      /* Real part is 0.0.  */
 	      __real__ retval = M_COPYSIGN (0, negate ? -1 : 1);
-	      __imag__ retval = M_NAN + M_NAN;
+	      __imag__ retval = M_NAN;
 
 	      if (icls == FP_INFINITE)
 		feraiseexcept (FE_INVALID);
@@ -143,9 +143,8 @@ M_DECL_FUNC (__csinh) (CFLOAT x)
 	}
       else
 	{
-	  /* The addition raises the invalid exception.  */
 	  __real__ retval = M_HUGE_VAL;
-	  __imag__ retval = M_NAN + M_NAN;
+	  __imag__ retval = M_NAN;
 
 	  if (icls == FP_INFINITE)
 	    feraiseexcept (FE_INVALID);

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

Summary of changes:
 ChangeLog               |    6 ++++++
 math/s_ccosh_template.c |    5 ++---
 math/s_csinh_template.c |    5 ++---
 3 files changed, 10 insertions(+), 6 deletions(-)


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



More information about the Glibc-cvs mailing list