about summary refs log tree commit diff
path: root/math/test-femode-traps.c
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@wdc.com>2019-04-30 02:24:49 +0100
committerMaciej W. Rozycki <macro@wdc.com>2019-04-30 02:24:49 +0100
commit87c266d758d29e52bfb717f90025ef1fe2663d38 (patch)
tree181e7d8204167f33cc171887a20cffebfcd4e9d0 /math/test-femode-traps.c
parent6cac323c8dd78668e65aaa29f044cbd33c1a66a5 (diff)
downloadglibc-87c266d758d29e52bfb717f90025ef1fe2663d38.tar.gz
glibc-87c266d758d29e52bfb717f90025ef1fe2663d38.tar.xz
glibc-87c266d758d29e52bfb717f90025ef1fe2663d38.zip
Fix -O1 compilation errors with `__ddivl' and `__fdivl' [BZ #19444]
Complementing commit 4a06ceea33ec ("sysdeps/ieee754/soft-fp: ignore
maybe-uninitialized with -O [BZ #19444]") and commit 27c5e756a2a8
("sysdeps/ieee754: prevent maybe-uninitialized errors with -O [BZ
#19444]") also fix compilation errors observed at -O1 in `__ddivl' and
`__fdivl' with GCC 9 and RISC-V targets:

In file included from ../soft-fp/soft-fp.h:318,
                 from ../sysdeps/ieee754/soft-fp/s_fdivl.c:27:
../sysdeps/ieee754/soft-fp/s_fdivl.c: In function '__fdivl':
../soft-fp/op-2.h:108:9: error: 'R_f1' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  108 |         : (X##_f1 << (2*_FP_W_TYPE_SIZE - (N)))) \
      |         ^
../sysdeps/ieee754/soft-fp/s_fdivl.c:37:14: note: 'R_f1' was declared here
   37 |   FP_DECL_Q (R);
      |              ^
../soft-fp/op-common.h:39:3: note: in expansion of macro '_FP_FRAC_DECL_2'
   39 |   _FP_FRAC_DECL_##wc (X)
      |   ^~~~~~~~~~~~~~
../soft-fp/quad.h:226:24: note: in expansion of macro '_FP_DECL'
  226 | # define FP_DECL_Q(X)  _FP_DECL (2, X)
      |                        ^~~~~~~~
../sysdeps/ieee754/soft-fp/s_fdivl.c:37:3: note: in expansion of macro 'FP_DECL_Q'
   37 |   FP_DECL_Q (R);
      |   ^~~~~~~~~
../soft-fp/op-2.h:109:8: error: 'R_f0' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  109 |        | X##_f0) != 0));    \
      |        ^
../sysdeps/ieee754/soft-fp/s_fdivl.c:37:14: note: 'R_f0' was declared here
   37 |   FP_DECL_Q (R);
      |              ^
../soft-fp/op-common.h:39:3: note: in expansion of macro '_FP_FRAC_DECL_2'
   39 |   _FP_FRAC_DECL_##wc (X)
      |   ^~~~~~~~~~~~~~
../soft-fp/quad.h:226:24: note: in expansion of macro '_FP_DECL'
  226 | # define FP_DECL_Q(X)  _FP_DECL (2, X)
      |                        ^~~~~~~~
../sysdeps/ieee754/soft-fp/s_fdivl.c:37:3: note: in expansion of macro 'FP_DECL_Q'
   37 |   FP_DECL_Q (R);
      |   ^~~~~~~~~
In file included from ../soft-fp/soft-fp.h:318,
                 from ../sysdeps/ieee754/soft-fp/s_ddivl.c:31:
../sysdeps/ieee754/soft-fp/s_ddivl.c: In function '__ddivl':
../soft-fp/op-2.h:98:25: error: 'R_f1' may be used uninitialized in this function [-Werror=maybe-uninitialized]
   98 |        X##_f0 = (X##_f1 << (_FP_W_TYPE_SIZE - (N)) | X##_f0 >> (N) \
      |                         ^~
../sysdeps/ieee754/soft-fp/s_ddivl.c:41:14: note: 'R_f1' was declared here
   41 |   FP_DECL_Q (R);
      |              ^
../soft-fp/op-2.h:37:36: note: in definition of macro '_FP_FRAC_DECL_2'
   37 |   _FP_W_TYPE X##_f0 _FP_ZERO_INIT, X##_f1 _FP_ZERO_INIT
      |                                    ^
../soft-fp/quad.h:226:24: note: in expansion of macro '_FP_DECL'
  226 | # define FP_DECL_Q(X)  _FP_DECL (2, X)
      |                        ^~~~~~~~
../sysdeps/ieee754/soft-fp/s_ddivl.c:41:3: note: in expansion of macro 'FP_DECL_Q'
   41 |   FP_DECL_Q (R);
      |   ^~~~~~~~~
../soft-fp/op-2.h:101:17: error: 'R_f0' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  101 |       : (X##_f0 << (_FP_W_TYPE_SIZE - (N))) != 0)); \
      |                 ^~
../sysdeps/ieee754/soft-fp/s_ddivl.c:41:14: note: 'R_f0' was declared here
   41 |   FP_DECL_Q (R);
      |              ^
../soft-fp/op-2.h:37:14: note: in definition of macro '_FP_FRAC_DECL_2'
   37 |   _FP_W_TYPE X##_f0 _FP_ZERO_INIT, X##_f1 _FP_ZERO_INIT
      |              ^
../soft-fp/quad.h:226:24: note: in expansion of macro '_FP_DECL'
  226 | # define FP_DECL_Q(X)  _FP_DECL (2, X)
      |                        ^~~~~~~~
../sysdeps/ieee754/soft-fp/s_ddivl.c:41:3: note: in expansion of macro 'FP_DECL_Q'
   41 |   FP_DECL_Q (R);
      |   ^~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [.../sysd-rules:587: .../math/s_fdivl.o] Error 1
make[2]: *** Waiting for unfinished jobs....
cc1: all warnings being treated as errors
make[2]: *** [.../sysd-rules:587: .../math/s_ddivl.o] Error 1

This comes from cases in _FP_DIV that return a result described as
FP_CLS_ZERO or FP_CLS_INF and do not initialize the fractional part,
which is then operated on unconditionally in FP_TRUNC_COOKED before
being ignored by _FP_PACK_CANONICAL.

Clearly at this optimization level GCC cannot guarantee to be able to
determine that the fractional part is ultimately unused, so ignore the
error as with the earlier commits referred, letting compilation proceed.

	[BZ #19444]
	* sysdeps/ieee754/soft-fp/s_ddivl.c (__ddivl): Ignore errors
	from `-Wmaybe-uninitialized'.
	* sysdeps/ieee754/soft-fp/s_fdivl.c (__fdivl): Likewise.
Diffstat (limited to 'math/test-femode-traps.c')
0 files changed, 0 insertions, 0 deletions