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.24-74-gb65f0b7


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  b65f0b7b2ecd144800830633a4c2719f11775572 (commit)
      from  2c820533c61fed175390bc6058afbbe42d2edc37 (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=b65f0b7b2ecd144800830633a4c2719f11775572

commit b65f0b7b2ecd144800830633a4c2719f11775572
Author: Stefan Liebler <stli@linux.vnet.ibm.com>
Date:   Thu Aug 18 12:20:35 2016 +0200

    Get rid of array-bounds warning in __kernel_rem_pio2[f] with gcc 6.1 -O3.
    
    On s390x I get the following werror when build with gcc 6.1 (or current gcc head) and -O3:
    ../sysdeps/ieee754/dbl-64/k_rem_pio2.c: In function â??__kernel_rem_pio2â??:
    ../sysdeps/ieee754/dbl-64/k_rem_pio2.c:254:18: error: array subscript is below array bounds [-Werror=array-bounds]
        for (k = 1; iq[jk - k] == 0; k++)
                    ~~^~~~~~~~
    I get the same error with sysdeps/ieee754/flt-32/k_rem_pio2f.c.
    
    This patch adds DIAG_* macros around it.
    
    ChangeLog:
    
    	* sysdeps/ieee754/dbl-64/k_rem_pio2.c (__kernel_rem_pio2):
    	Use DIAG_*_NEEDS_COMMENT macro to get rid of array-bounds warning.
    	* sysdeps/ieee754/flt-32/k_rem_pio2f.c (__kernel_rem_pio2f):
    	Likewise.

diff --git a/ChangeLog b/ChangeLog
index e95dbd5..59c68d8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2016-08-18  Stefan Liebler  <stli@linux.vnet.ibm.com>
+
+	* sysdeps/ieee754/dbl-64/k_rem_pio2.c (__kernel_rem_pio2):
+	Use DIAG_*_NEEDS_COMMENT macro to get rid of array-bounds warning.
+	* sysdeps/ieee754/flt-32/k_rem_pio2f.c (__kernel_rem_pio2f):
+	Likewise.
+
 2016-08-18  Florian Weimer  <fweimer@redhat.com>
 
 	[BZ #16907]
diff --git a/sysdeps/ieee754/dbl-64/k_rem_pio2.c b/sysdeps/ieee754/dbl-64/k_rem_pio2.c
index e58c9e8..d853b65 100644
--- a/sysdeps/ieee754/dbl-64/k_rem_pio2.c
+++ b/sysdeps/ieee754/dbl-64/k_rem_pio2.c
@@ -132,6 +132,7 @@ static char rcsid[] = "$NetBSD: k_rem_pio2.c,v 1.7 1995/05/10 20:46:25 jtc Exp $
 
 #include <math.h>
 #include <math_private.h>
+#include <libc-internal.h>
 
 static const int init_jk[] = {2,3,4,6}; /* initial value for jk */
 
@@ -251,8 +252,17 @@ recompute:
 	j |= iq[i];
       if (j == 0)      /* need recomputation */
 	{
+	  /* On s390x gcc 6.1 -O3 produces the warning "array subscript is below
+	     array bounds [-Werror=array-bounds]".  Only __ieee754_rem_pio2l
+	     calls __kernel_rem_pio2 for normal numbers and |x| > pi/4 in case
+	     of ldbl-96 and |x| > 3pi/4 in case of ldbl-128[ibm].
+	     Thus x can't be zero and ipio2 is not zero, too.  Thus not all iq[]
+	     values can't be zero.  */
+	  DIAG_PUSH_NEEDS_COMMENT;
+	  DIAG_IGNORE_NEEDS_COMMENT (6.1, "-Warray-bounds");
 	  for (k = 1; iq[jk - k] == 0; k++)
 	    ;                               /* k = no. of terms needed */
+	  DIAG_POP_NEEDS_COMMENT;
 
 	  for (i = jz + 1; i <= jz + k; i++) /* add q[jz+1] to q[jz+k] */
 	    {
diff --git a/sysdeps/ieee754/flt-32/k_rem_pio2f.c b/sysdeps/ieee754/flt-32/k_rem_pio2f.c
index 392afdb..52ffb09 100644
--- a/sysdeps/ieee754/flt-32/k_rem_pio2f.c
+++ b/sysdeps/ieee754/flt-32/k_rem_pio2f.c
@@ -19,6 +19,7 @@ static char rcsid[] = "$NetBSD: k_rem_pio2f.c,v 1.4 1995/05/10 20:46:28 jtc Exp
 
 #include <math.h>
 #include <math_private.h>
+#include <libc-internal.h>
 
 /* In the float version, the input parameter x contains 8 bit
    integers, not 24 bit integers.  113 bit precision is not supported.  */
@@ -122,7 +123,16 @@ recompute:
 	    j = 0;
 	    for (i=jz-1;i>=jk;i--) j |= iq[i];
 	    if(j==0) { /* need recomputation */
+		/* On s390x gcc 6.1 -O3 produces the warning "array subscript is
+		   below array bounds [-Werror=array-bounds]".  Only
+		   __ieee754_rem_pio2f calls __kernel_rem_pio2f for normal
+		   numbers and |x| ~> 2^7*(pi/2).  Thus x can't be zero and
+		   ipio2 is not zero, too.  Thus not all iq[] values can't be
+		   zero.  */
+		DIAG_PUSH_NEEDS_COMMENT;
+		DIAG_IGNORE_NEEDS_COMMENT (6.1, "-Warray-bounds");
 		for(k=1;iq[jk-k]==0;k++);   /* k = no. of terms needed */
+		DIAG_POP_NEEDS_COMMENT;
 
 		for(i=jz+1;i<=jz+k;i++) {   /* add q[jz+1] to q[jz+k] */
 		    f[jx+i] = (float) ipio2[jv+i];

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

Summary of changes:
 ChangeLog                            |    7 +++++++
 sysdeps/ieee754/dbl-64/k_rem_pio2.c  |   10 ++++++++++
 sysdeps/ieee754/flt-32/k_rem_pio2f.c |   10 ++++++++++
 3 files changed, 27 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]