summaryrefslogtreecommitdiffstats
path: root/lib/msun/src/e_log10.c
diff options
context:
space:
mode:
authordas <das@FreeBSD.org>2013-05-27 08:50:10 +0000
committerdas <das@FreeBSD.org>2013-05-27 08:50:10 +0000
commite7b0a63c190c7ecb475b09f41387a75952540f49 (patch)
treefe26b077920f74a021643eb895e508cd1a90d404 /lib/msun/src/e_log10.c
parente97a0dc9656bc3f5214866731094513064e59725 (diff)
downloadFreeBSD-src-e7b0a63c190c7ecb475b09f41387a75952540f49.zip
FreeBSD-src-e7b0a63c190c7ecb475b09f41387a75952540f49.tar.gz
Fix some regressions caused by the switch from gcc to clang. The fixes
are workarounds for various symptoms of the problem described in clang bugs 3929, 8100, 8241, 10409, and 12958. The regression tests did their job: they failed, someone brought it up on the mailing lists, and then the issue got ignored for 6 months. Oops. There may still be some regressions for functions we don't have test coverage for yet.
Diffstat (limited to 'lib/msun/src/e_log10.c')
-rw-r--r--lib/msun/src/e_log10.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/msun/src/e_log10.c b/lib/msun/src/e_log10.c
index 104d257..a795129 100644
--- a/lib/msun/src/e_log10.c
+++ b/lib/msun/src/e_log10.c
@@ -34,6 +34,7 @@ log10_2hi = 3.01029995663611771306e-01, /* 0x3FD34413, 0x509F6000 */
log10_2lo = 3.69423907715893078616e-13; /* 0x3D59FEF3, 0x11F12B36 */
static const double zero = 0.0;
+static volatile double vzero = 0.0;
double
__ieee754_log10(double x)
@@ -47,7 +48,7 @@ __ieee754_log10(double x)
k=0;
if (hx < 0x00100000) { /* x < 2**-1022 */
if (((hx&0x7fffffff)|lx)==0)
- return -two54/zero; /* log(+-0)=-inf */
+ return -two54/vzero; /* log(+-0)=-inf */
if (hx<0) return (x-x)/zero; /* log(-#) = NaN */
k -= 54; x *= two54; /* subnormal number, scale up x */
GET_HIGH_WORD(hx,x);
OpenPOWER on IntegriCloud