aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2021-02-09 21:06:51 +0000
committerDimitry Andric <dim@FreeBSD.org>2021-02-09 21:07:05 +0000
commitac76bc1145dd7f4476e5d982ce8f355f71015713 (patch)
tree238f2faf0d231f25aafefbdc3c2ec863faab6bb1 /lib
parent011b7317dbb5038a95b9b4fca050325a62f3991e (diff)
downloadsrc-ac76bc1145dd7f4476e5d982ce8f355f71015713.tar.gz
src-ac76bc1145dd7f4476e5d982ce8f355f71015713.zip
Fix lib/msun's ctrig_test/test_inf_inputs test case with clang >= 10
This sprinkles a few strategic volatiles in an attempt to defeat clang's optimization interfering with the expected floating-point exception flags. Reported by: lwhsu PR: 244732 MFC after: 3 days
Diffstat (limited to 'lib')
-rw-r--r--lib/msun/src/s_ccoshf.c2
-rw-r--r--lib/msun/src/s_ctanh.c2
-rw-r--r--lib/msun/src/s_ctanhf.c2
-rw-r--r--lib/msun/tests/ctrig_test.c3
4 files changed, 3 insertions, 6 deletions
diff --git a/lib/msun/src/s_ccoshf.c b/lib/msun/src/s_ccoshf.c
index 5d7a09ba5f8d..e72395c277d5 100644
--- a/lib/msun/src/s_ccoshf.c
+++ b/lib/msun/src/s_ccoshf.c
@@ -43,7 +43,7 @@ static const float huge = 0x1p127;
float complex
ccoshf(float complex z)
{
- float x, y, h;
+ volatile float x, y, h;
int32_t hx, hy, ix, iy;
x = crealf(z);
diff --git a/lib/msun/src/s_ctanh.c b/lib/msun/src/s_ctanh.c
index 88afeb50e26e..13eb9d40b678 100644
--- a/lib/msun/src/s_ctanh.c
+++ b/lib/msun/src/s_ctanh.c
@@ -76,7 +76,7 @@ __FBSDID("$FreeBSD$");
double complex
ctanh(double complex z)
{
- double x, y;
+ volatile double x, y;
double t, beta, s, rho, denom;
uint32_t hx, ix, lx;
diff --git a/lib/msun/src/s_ctanhf.c b/lib/msun/src/s_ctanhf.c
index d2bd0b6786f0..7d375eafd2ae 100644
--- a/lib/msun/src/s_ctanhf.c
+++ b/lib/msun/src/s_ctanhf.c
@@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$");
float complex
ctanhf(float complex z)
{
- float x, y;
+ volatile float x, y;
float t, beta, s, rho, denom;
uint32_t hx, ix;
diff --git a/lib/msun/tests/ctrig_test.c b/lib/msun/tests/ctrig_test.c
index effc4cfce281..45b2b78b0416 100644
--- a/lib/msun/tests/ctrig_test.c
+++ b/lib/msun/tests/ctrig_test.c
@@ -248,9 +248,6 @@ ATF_TC_BODY(test_inf_inputs, tc)
long double complex z, c, s;
unsigned i;
- if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false))
- atf_tc_expect_fail("https://bugs.freebsd.org/244732");
-
/*
* IN CSINH CCOSH CTANH
* Inf,Inf +-Inf,NaN inval +-Inf,NaN inval 1,+-0