about summary refs log tree commit diff
path: root/sysdeps/ieee754/dbl-64/k_rem_pio2.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/ieee754/dbl-64/k_rem_pio2.c')
-rw-r--r--sysdeps/ieee754/dbl-64/k_rem_pio2.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sysdeps/ieee754/dbl-64/k_rem_pio2.c b/sysdeps/ieee754/dbl-64/k_rem_pio2.c
index e58c9e854c..d853b65a05 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] */
 	    {