Re: HEADS-UP: gcc-4.2 import appears to miscompile libm.

From: Steve Kargl <sgk_at_troutmask.apl.washington.edu>
Date: Sat, 26 May 2007 16:31:16 -0700
On Sat, May 26, 2007 at 07:09:16PM -0400, Wes Morgan wrote:
> 
> Working from -O towards -O2 based on the info pages, I can "reproduce" the 
> problem with "-O -fstrict-aliasing -fgcse"... However, -O2 with
> -fno-strict-aliasing by itself seems to work around the issue. At first 
> glance it looks like a possible interaction between several optimizations.
> 

Ths patch fixes the problem.

--- s_frexpf.c.orig     Sat May 26 16:26:50 2007
+++ s_frexpf.c  Sat May 26 16:28:03 2007
_at__at_ -39,6 +39,9 _at__at_
        }
        *eptr += (ix>>23)-126;
        hx = (hx&0x807fffff)|0x3f000000;
+#if 0
        *(int*)&x = hx;
+#endif
+       SET_FLOAT_WORD(x,hx);
        return x;
 }

-- 
Steve
Received on Sat May 26 2007 - 21:32:50 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:11 UTC