From 669152498ad89a026283604d82722fad3309b72f Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Sun, 4 Dec 2005 08:57:54 +0000 Subject: [PATCH] Use the usual volatile hack to trick gcc into clipping any extra precision on assignment. Extra precision on i386's broke hi+lo decomposition in the usual way. It caused all except 1 of the 62343 errors of more than 1 ulp for log1pf() on i386's with gcc -O [-fno-float-store]. --- lib/msun/src/s_log1pf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/msun/src/s_log1pf.c b/lib/msun/src/s_log1pf.c index c2f01c71e5ef..76fb33ccf017 100644 --- a/lib/msun/src/s_log1pf.c +++ b/lib/msun/src/s_log1pf.c @@ -62,7 +62,7 @@ log1pf(float x) if (hx >= 0x7f800000) return x+x; if(k!=0) { if(hx<0x5a000000) { - u = (float)1.0+x; + *(volatile float *)&u = (float)1.0+x; GET_FLOAT_WORD(hu,u); k = (hu>>23)-127; /* correction term */