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.21-387-g9124ccf


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  9124ccf76abc5a2ffe4603e6424b1dc2b5a5db44 (commit)
      from  89f3b6e18c6e7833438789746fcfc2e7189f7cac (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=9124ccf76abc5a2ffe4603e6424b1dc2b5a5db44

commit 9124ccf76abc5a2ffe4603e6424b1dc2b5a5db44
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Thu May 21 23:44:33 2015 +0000

    Fix lgamma implementations for -Wuninitialized.
    
    If you remove the "override CFLAGS += -Wno-uninitialized" in
    math/Makefile, you get errors from lgamma implementations of the form:
    
    ../sysdeps/ieee754/dbl-64/e_lgamma_r.c: In function '__ieee754_lgamma_r':
    ../sysdeps/ieee754/dbl-64/e_lgamma_r.c:297:13: error: 'nadj' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      if(hx<0) r = nadj - r;
    
    This is one of the standard kinds of false positive uninitialized
    warnings: nadj is set under a certain condition, and then later used
    under the same condition.  This patch uses DIAG_* macros to suppress
    the warning on the use of nadj.  The ldbl-128 / ldbl-128ibm
    implementation has a substantially different structure that avoids
    this issue.
    
    Tested for x86_64.  (In fact this patch eliminates the need for that
    -Wno-uninitialized on x86_64, but I want to test on more architectures
    before removing it.)
    
    	* sysdeps/ieee754/dbl-64/e_lgamma_r.c: Include <libc-internal.h>.
    	(__ieee754_lgamma_r): Ignore uninitialized warnings around use of
    	NADJ.
    	* sysdeps/ieee754/flt-32/e_lgammaf_r.c: Include <libc-internal.h>.
    	(__ieee754_lgammaf_r): Ignore uninitialized warnings around use of
    	NADJ.
    	* sysdeps/ieee754/ldbl-96/e_lgammal_r.c: Include <libc-internal.h>.
    	(__ieee754_lgammal_r): Ignore uninitialized warnings around use of
    	NADJ.

diff --git a/ChangeLog b/ChangeLog
index bca6ba7..ba7a400 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2015-05-21  Joseph Myers  <joseph@codesourcery.com>
 
+	* sysdeps/ieee754/dbl-64/e_lgamma_r.c: Include <libc-internal.h>.
+	(__ieee754_lgamma_r): Ignore uninitialized warnings around use of
+	NADJ.
+	* sysdeps/ieee754/flt-32/e_lgammaf_r.c: Include <libc-internal.h>.
+	(__ieee754_lgammaf_r): Ignore uninitialized warnings around use of
+	NADJ.
+	* sysdeps/ieee754/ldbl-96/e_lgammal_r.c: Include <libc-internal.h>.
+	(__ieee754_lgammal_r): Ignore uninitialized warnings around use of
+	NADJ.
+
 	* sysdeps/ieee754/dbl-64/mpa.c (norm): Remove if condition on
 	(p == 4) case.
 
diff --git a/sysdeps/ieee754/dbl-64/e_lgamma_r.c b/sysdeps/ieee754/dbl-64/e_lgamma_r.c
index af7d06c..fc6f594 100644
--- a/sysdeps/ieee754/dbl-64/e_lgamma_r.c
+++ b/sysdeps/ieee754/dbl-64/e_lgamma_r.c
@@ -77,6 +77,7 @@
  *
  */
 
+#include <libc-internal.h>
 #include <math.h>
 #include <math_private.h>
 
@@ -294,7 +295,18 @@ __ieee754_lgamma_r(double x, int *signgamp)
 	} else
     /* 2**58 <= x <= inf */
 	    r =  x*(__ieee754_log(x)-one);
+	/* NADJ is set for negative arguments but not otherwise,
+	   resulting in warnings that it may be used uninitialized
+	   although in the cases where it is used it has always been
+	   set.  */
+	DIAG_PUSH_NEEDS_COMMENT;
+#if __GNUC_PREREQ (4, 7)
+	DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wmaybe-uninitialized");
+#else
+	DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wuninitialized");
+#endif
 	if(hx<0) r = nadj - r;
+	DIAG_POP_NEEDS_COMMENT;
 	return r;
 }
 strong_alias (__ieee754_lgamma_r, __lgamma_r_finite)
diff --git a/sysdeps/ieee754/flt-32/e_lgammaf_r.c b/sysdeps/ieee754/flt-32/e_lgammaf_r.c
index 4743bee..c0bf415 100644
--- a/sysdeps/ieee754/flt-32/e_lgammaf_r.c
+++ b/sysdeps/ieee754/flt-32/e_lgammaf_r.c
@@ -13,6 +13,7 @@
  * ====================================================
  */
 
+#include <libc-internal.h>
 #include <math.h>
 #include <math_private.h>
 
@@ -229,7 +230,18 @@ __ieee754_lgammaf_r(float x, int *signgamp)
 	} else
     /* 2**26 <= x <= inf */
 	    r =  x*(__ieee754_logf(x)-one);
+	/* NADJ is set for negative arguments but not otherwise,
+	   resulting in warnings that it may be used uninitialized
+	   although in the cases where it is used it has always been
+	   set.  */
+	DIAG_PUSH_NEEDS_COMMENT;
+#if __GNUC_PREREQ (4, 7)
+	DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wmaybe-uninitialized");
+#else
+	DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wuninitialized");
+#endif
 	if(hx<0) r = nadj - r;
+	DIAG_POP_NEEDS_COMMENT;
 	return r;
 }
 strong_alias (__ieee754_lgammaf_r, __lgammaf_r_finite)
diff --git a/sysdeps/ieee754/ldbl-96/e_lgammal_r.c b/sysdeps/ieee754/ldbl-96/e_lgammal_r.c
index 1a95f84..0cc35f9 100644
--- a/sysdeps/ieee754/ldbl-96/e_lgammal_r.c
+++ b/sysdeps/ieee754/ldbl-96/e_lgammal_r.c
@@ -91,6 +91,7 @@
  *
  */
 
+#include <libc-internal.h>
 #include <math.h>
 #include <math_private.h>
 
@@ -423,8 +424,18 @@ __ieee754_lgammal_r (long double x, int *signgamp)
   else
     /* 2**66 <= x <= inf */
     r = x * (__ieee754_logl (x) - one);
+  /* NADJ is set for negative arguments but not otherwise, resulting
+     in warnings that it may be used uninitialized although in the
+     cases where it is used it has always been set.  */
+  DIAG_PUSH_NEEDS_COMMENT;
+#if __GNUC_PREREQ (4, 7)
+  DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wmaybe-uninitialized");
+#else
+  DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wuninitialized");
+#endif
   if (se & 0x8000)
     r = nadj - r;
+  DIAG_POP_NEEDS_COMMENT;
   return r;
 }
 strong_alias (__ieee754_lgammal_r, __lgammal_r_finite)

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

Summary of changes:
 ChangeLog                             |   10 ++++++++++
 sysdeps/ieee754/dbl-64/e_lgamma_r.c   |   12 ++++++++++++
 sysdeps/ieee754/flt-32/e_lgammaf_r.c  |   12 ++++++++++++
 sysdeps/ieee754/ldbl-96/e_lgammal_r.c |   11 +++++++++++
 4 files changed, 45 insertions(+), 0 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]