From owner-freebsd-current@FreeBSD.ORG Sun May 27 08:53:14 2007 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E458816A46F for ; Sun, 27 May 2007 08:53:14 +0000 (UTC) (envelope-from shoesoft@gmx.net) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id 3D71813C455 for ; Sun, 27 May 2007 08:53:14 +0000 (UTC) (envelope-from shoesoft@gmx.net) Received: (qmail invoked by alias); 27 May 2007 08:53:12 -0000 Received: from h081217094222.dyn.cm.kabsi.at (EHLO taxman.pepperland) [81.217.94.222] by mail.gmx.net (mp035) with SMTP; 27 May 2007 10:53:12 +0200 X-Authenticated: #16703784 X-Provags-ID: V01U2FsdGVkX19ZbyA3N3VZm8QJnE1S7jukHAKnv4/OwUKzfcgrdb ZpzlGsX5fopfAK From: Stefan Ehmann To: freebsd-current@freebsd.org Date: Sun, 27 May 2007 10:53:09 +0200 User-Agent: KMail/1.9.6 References: <20070526193128.GB54875@troutmask.apl.washington.edu> <20070526190023.C98508@volatile.chemikals.org> <20070526233116.GA56054@troutmask.apl.washington.edu> In-Reply-To: <20070526233116.GA56054@troutmask.apl.washington.edu> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200705271053.10725.shoesoft@gmx.net> X-Y-GMX-Trusted: 0 Cc: Kris Kennaway , Steve Kargl , Ed Schouten Subject: Re: HEADS-UP: gcc-4.2 import appears to miscompile libm. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 May 2007 08:53:15 -0000 On Sunday 27 May 2007 01:31:16 Steve Kargl wrote: > 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 > @@ -39,6 +39,9 @@ > } > *eptr += (ix>>23)-126; > hx = (hx&0x807fffff)|0x3f000000; > +#if 0 > *(int*)&x = hx; > +#endif > + SET_FLOAT_WORD(x,hx); > return x; > } -fno-strict-aliasing is used by default for me (i386). Also, if you use -Wall the compiler outputs a warning. [root@something /usr/src/lib/msun/src]# cc -O2 -Wall -pipe -c s_frexpf.c s_frexpf.c: In function 'frexpf': s_frexpf.c:42: warning: dereferencing type-punned pointer will break strict-aliasing rules