]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
s_sincosf.h: Change pio4 type to float [BZ #28713]
authorH.J. Lu <hjl.tools@gmail.com>
Mon, 20 Dec 2021 22:37:26 +0000 (14:37 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 21 Dec 2021 16:56:12 +0000 (08:56 -0800)
s_cosf.c and s_sinf.c have

  if (abstop12 (y) < abstop12 (pio4))

where abstop12 takes a float argument, but pio4 is static const double.
pio4 is used only in calls to abstop12 and never in arithmetic.  Apply

-static const double pio4 = 0x1.921FB54442D18p-1;
+static const float pio4 = 0x1.921FB6p-1f;

to fix:

FAIL: math/test-float-cos
FAIL: math/test-float-sin
FAIL: math/test-float-sincos
FAIL: math/test-float32-cos
FAIL: math/test-float32-sin
FAIL: math/test-float32-sincos

when compiling with GCC 12.

Reviewed-by: Paul Zimmermann <Paul.Zimmermann@inria.fr>
sysdeps/ieee754/flt-32/s_sincosf.h

index 125ab7f846c463c676607cbc4eaf715acbf41893..372d8542c2c9a9c7da68179607ef492e03f84841 100644 (file)
@@ -24,7 +24,7 @@
 /* 2PI * 2^-64.  */
 static const double pi63 = 0x1.921FB54442D18p-62;
 /* PI / 4.  */
-static const double pio4 = 0x1.921FB54442D18p-1;
+static const float pio4 = 0x1.921FB6p-1f;
 
 /* Polynomial data (the cosine polynomial is negated in the 2nd entry).  */
 extern const sincos_t __sincosf_table[2] attribute_hidden;