]> sourceware.org Git - glibc.git/commit
Fix i686-linux-gnu build with GCC mainline.
authorJoseph Myers <joseph@codesourcery.com>
Tue, 22 May 2018 16:55:04 +0000 (16:55 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Tue, 22 May 2018 16:55:04 +0000 (16:55 +0000)
commit3d6302a5467035077ecfe02cdb73d3d467a9e004
tree64a256575c4e05be204e64efc51e55aacb9dc548
parent5c5c0dd747070db624c8e2c43691cec854f114ef
Fix i686-linux-gnu build with GCC mainline.

Building with recent GCC mainline for i686-linux-gnu is failing with:

../sysdeps/ieee754/flt-32/k_rem_pio2f.c: In function '__kernel_rem_pio2f':
../sysdeps/ieee754/flt-32/k_rem_pio2f.c:186:28: error: 'fq[0]' may be used uninitialized in this function [-Werror=maybe-uninitialized]
   fv = math_narrow_eval (fq[0]-fv);
                            ^

and

../sysdeps/ieee754/dbl-64/k_rem_pio2.c: In function '__kernel_rem_pio2':
../sysdeps/ieee754/dbl-64/k_rem_pio2.c:333:32: error: 'fq[0]' may be used uninitialized in this function [-Werror=maybe-uninitialized]
       fv = math_narrow_eval (fq[0] - fv);
                                ^

These are similar to -Warray-bounds cases for which the DIAG_* macros
are already used in those files: the array element is in fact always
initialized, but the reasoning that it is depends on another array not
having been all zero at an earlier point, which depends on the
functions not being called with zero arguments.  Thus, this patch uses
DIAG_* to disable -Wmaybe-uninitialized for this code.

(The warning may be i686-specific because of math_narrow_eval somehow
perturbing what the compiler does with this code enough to cause the
warning.  I don't know why it doesn't appear for i686-gnu.)

Tested with build-many-glibcs.py that this fixes the i686 build in
this configuration.

* 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.
ChangeLog
sysdeps/ieee754/dbl-64/k_rem_pio2.c
sysdeps/ieee754/flt-32/k_rem_pio2f.c
This page took 0.03971 seconds and 5 git commands to generate.