Fix -Werror=constant-logical-operand errors in soft-fp

Building for sparc64-linux-gnu with GCC mainline produces a series of
-Werror=constant-logical-operand errors in soft-fp code, relating to
calls to _FP_TO_INT where rsigned is -1 not 0 or 1.  Use explicit != 0
in the soft-fp code to avoid these errors.

Tested with build-many-glibcs.py (compilers and glibcs builds) for
sparc64-linux-gnu with GCC mainline.
This commit is contained in:
Joseph Myers
2026-06-10 16:33:27 +00:00
parent 690472e2a5
commit d8fa402f5e
+2 -2
View File
@@ -1510,7 +1510,7 @@
} \
\
if (_FP_EXPBIAS_##fs + (rsize) - 1 < _FP_EXPMAX_##fs \
&& (rsigned) \
&& (rsigned) != 0 \
&& X##_s \
&& X##_e == _FP_EXPBIAS_##fs + (rsize) - 1) \
{ \
@@ -1555,7 +1555,7 @@
_FP_FRACBITS_##fs); \
_FP_FRAC_ASSEMBLE_##wc ((r), X, (rsize)); \
} \
if ((rsigned) && X##_s) \
if ((rsigned) != 0 && X##_s) \
(r) = -(r); \
if ((rsigned) == 2 && X##_e >= _FP_EXPBIAS_##fs + (rsize) - 1) \
{ \