aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--sysdeps/ieee754/dbl-64/k_rem_pio2.c9
-rw-r--r--sysdeps/ieee754/flt-32/k_rem_pio2f.c10
3 files changed, 24 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 6c9331b894..f11b1c2bc3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2018-05-22 Joseph Myers <joseph@codesourcery.com>
+ * sysdeps/ieee754/dbl-64/k_rem_pio2.c (__kernel_rem_pio2): Ignore
+ -Wmaybe-uninitialized around access to fq[0].
+ * sysdeps/ieee754/flt-32/k_rem_pio2f.c (__kernel_rem_pio2f):
+ Likewise.
+
[BZ #18471]
* sysdeps/unix/make-syscalls.sh (emit_weak_aliases): Use weak
aliases for non-libc case of versioned symbols.
diff --git a/sysdeps/ieee754/dbl-64/k_rem_pio2.c b/sysdeps/ieee754/dbl-64/k_rem_pio2.c
index 820fe7787e..d8403dc345 100644
--- a/sysdeps/ieee754/dbl-64/k_rem_pio2.c
+++ b/sysdeps/ieee754/dbl-64/k_rem_pio2.c
@@ -330,7 +330,16 @@ recompute:
for (i = jz; i >= 0; i--)
fv = math_narrow_eval (fv + fq[i]);
y[0] = (ih == 0) ? fv : -fv;
+ /* GCC mainline (to be GCC 9), as of 2018-05-22 on i686, warns
+ that fq[0] may be used uninitialized. This is not possible
+ because jz is always nonnegative when the above loop
+ initializing fq is executed, because the result is never zero
+ to full precision (this function is not called for zero
+ arguments). */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_NEEDS_COMMENT (9, "-Wmaybe-uninitialized");
fv = math_narrow_eval (fq[0] - fv);
+ DIAG_POP_NEEDS_COMMENT;
for (i = 1; i <= jz; i++)
fv = math_narrow_eval (fv + fq[i]);
y[1] = (ih == 0) ? fv : -fv;
diff --git a/sysdeps/ieee754/flt-32/k_rem_pio2f.c b/sysdeps/ieee754/flt-32/k_rem_pio2f.c
index fdf2b5da2c..ea4915b765 100644
--- a/sysdeps/ieee754/flt-32/k_rem_pio2f.c
+++ b/sysdeps/ieee754/flt-32/k_rem_pio2f.c
@@ -183,7 +183,17 @@ recompute:
float fv = 0.0;
for (i=jz;i>=0;i--) fv = math_narrow_eval (fv + fq[i]);
y[0] = (ih==0)? fv: -fv;
+ /* GCC mainline (to be GCC 9), as of 2018-05-22 on
+ i686, warns that fq[0] may be used uninitialized.
+ This is not possible because jz is always
+ nonnegative when the above loop initializing fq is
+ executed, because the result is never zero to full
+ precision (this function is not called for zero
+ arguments). */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_NEEDS_COMMENT (9, "-Wmaybe-uninitialized");
fv = math_narrow_eval (fq[0]-fv);
+ DIAG_POP_NEEDS_COMMENT;
for (i=1;i<=jz;i++) fv = math_narrow_eval (fv + fq[i]);
y[1] = (ih==0)? fv: -fv;
break;