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.27.9000-1-gf1d7368


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  f1d7368196e27370dcb5dfa3319e102f33b9ad66 (commit)
      from  086ee48eaeaba871a2300daf85469671cc14c7e9 (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=f1d7368196e27370dcb5dfa3319e102f33b9ad66

commit f1d7368196e27370dcb5dfa3319e102f33b9ad66
Author: Carlos O'Donell <carlos@redhat.com>
Date:   Thu Feb 1 20:40:48 2018 +0000

    Fix -Os log1p, log1pf build (bug 21314).
    
    As reported in bug 21314, building log1p and log1pf fails with -Os
    because of a spurious -Wmaybe-uninitialized warning (reported there
    for GCC 5 for MIPS, I see it also with GCC 7 for x86_64).  This patch,
    based on the patches in the bug, fixes this using the DIAG_* macros.
    
    Tested for x86_64 with -Os that this eliminates those warnings and so
    allows the build to progress further.
    
    2018-02-01  Carlos O'Donell  <carlos@redhat.com>
    	    Ramin Seyed-Moussavi  <lordrasmus@gmail.com>
    	    Joseph Myers  <joseph@codesourcery.com>
    
    	[BZ #21314]
    	* sysdeps/ieee754/dbl-64/s_log1p.c: Include <libc-diag.h>.
    	(__log1p): Disable -Wmaybe-uninitialized for -Os around
    	computation using c.
    	* sysdeps/ieee754/flt-32/s_log1pf.c: Include <libc-diag.h>.
    	(__log1pf): Disable -Wmaybe-uninitialized for -Os around
    	computation using c.

diff --git a/ChangeLog b/ChangeLog
index 585e69d..7923327 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2018-02-01  Carlos O'Donell  <carlos@redhat.com>
+	    Ramin Seyed-Moussavi  <lordrasmus@gmail.com>
+	    Joseph Myers  <joseph@codesourcery.com>
+
+	[BZ #21314]
+	* sysdeps/ieee754/dbl-64/s_log1p.c: Include <libc-diag.h>.
+	(__log1p): Disable -Wmaybe-uninitialized for -Os around
+	computation using c.
+	* sysdeps/ieee754/flt-32/s_log1pf.c: Include <libc-diag.h>.
+	(__log1pf): Disable -Wmaybe-uninitialized for -Os around
+	computation using c.
+
 2018-02-01  Dmitry V. Levin  <ldv@altlinux.org>
 
 	* version.h (RELEASE): Set to "development".
diff --git a/sysdeps/ieee754/dbl-64/s_log1p.c b/sysdeps/ieee754/dbl-64/s_log1p.c
index 340f637..b7cf5ce 100644
--- a/sysdeps/ieee754/dbl-64/s_log1p.c
+++ b/sysdeps/ieee754/dbl-64/s_log1p.c
@@ -81,6 +81,7 @@
 #include <float.h>
 #include <math.h>
 #include <math_private.h>
+#include <libc-diag.h>
 
 static const double
   ln2_hi = 6.93147180369123816490e-01,  /* 3fe62e42 fee00000 */
@@ -191,5 +192,14 @@ __log1p (double x)
   if (k == 0)
     return f - (hfsq - s * (hfsq + R));
   else
-    return k * ln2_hi - ((hfsq - (s * (hfsq + R) + (k * ln2_lo + c))) - f);
+    {
+      /* With GCC 7 when compiling with -Os the compiler warns that c
+	 might be used uninitialized.  This can't be true because k
+	 must be 0 for c to be uninitialized and we handled that
+	 computation earlier without using c.  */
+      DIAG_PUSH_NEEDS_COMMENT;
+      DIAG_IGNORE_Os_NEEDS_COMMENT (7, "-Wmaybe-uninitialized");
+      return k * ln2_hi - ((hfsq - (s * (hfsq + R) + (k * ln2_lo + c))) - f);
+      DIAG_POP_NEEDS_COMMENT;
+    }
 }
diff --git a/sysdeps/ieee754/flt-32/s_log1pf.c b/sysdeps/ieee754/flt-32/s_log1pf.c
index ade60a2..009084e 100644
--- a/sysdeps/ieee754/flt-32/s_log1pf.c
+++ b/sysdeps/ieee754/flt-32/s_log1pf.c
@@ -16,6 +16,7 @@
 #include <float.h>
 #include <math.h>
 #include <math_private.h>
+#include <libc-diag.h>
 
 static const float
 ln2_hi =   6.9313812256e-01,	/* 0x3f317180 */
@@ -97,6 +98,18 @@ __log1pf(float x)
 	s = f/((float)2.0+f);
 	z = s*s;
 	R = z*(Lp1+z*(Lp2+z*(Lp3+z*(Lp4+z*(Lp5+z*(Lp6+z*Lp7))))));
-	if(k==0) return f-(hfsq-s*(hfsq+R)); else
-		 return k*ln2_hi-((hfsq-(s*(hfsq+R)+(k*ln2_lo+c)))-f);
+	if (k == 0)
+	  return f - (hfsq - s * (hfsq + R));
+	else
+	  {
+	    /* With GCC 7 when compiling with -Os the compiler warns
+	       that c might be used uninitialized.  This can't be true
+	       because k must be 0 for c to be uninitialized and we
+	       handled that computation earlier without using c.  */
+	    DIAG_PUSH_NEEDS_COMMENT;
+	    DIAG_IGNORE_Os_NEEDS_COMMENT (7, "-Wmaybe-uninitialized");
+	    return k * ln2_hi - ((hfsq - (s * (hfsq + R)
+					  + (k * ln2_lo + c))) - f);
+	    DIAG_POP_NEEDS_COMMENT;
+	  }
 }

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

Summary of changes:
 ChangeLog                         |   12 ++++++++++++
 sysdeps/ieee754/dbl-64/s_log1p.c  |   12 +++++++++++-
 sysdeps/ieee754/flt-32/s_log1pf.c |   17 +++++++++++++++--
 3 files changed, 38 insertions(+), 3 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]