From owner-freebsd-current@FreeBSD.ORG Sat May 26 23:09:20 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 6615716A46C for ; Sat, 26 May 2007 23:09:20 +0000 (UTC) (envelope-from morganw@chemikals.org) Received: from smtp2.sccoast.net (smtp2.sccoast.net [66.153.203.174]) by mx1.freebsd.org (Postfix) with ESMTP id 3E9CB13C448 for ; Sat, 26 May 2007 23:09:20 +0000 (UTC) (envelope-from morganw@chemikals.org) Received: from 34.158-pool-avail-mi.sccoast.net ([66.153.158.34]:61425 helo=volatile.chemikals.org) by smtp2.sccoast.net with esmtp (Exim 4.60) (envelope-from ) id 1Hs5Nu-0003Hz-V3; Sat, 26 May 2007 19:09:19 -0400 Received: from localhost (morganw@localhost [127.0.0.1]) by volatile.chemikals.org (8.13.8/8.13.8) with ESMTP id l4QN9Hmh005078; Sat, 26 May 2007 19:09:17 -0400 (EDT) (envelope-from morganw@chemikals.org) Date: Sat, 26 May 2007 19:09:16 -0400 (EDT) From: Wes Morgan To: Kris Kennaway In-Reply-To: <20070526225731.GA56181@xor.obsecurity.org> Message-ID: <20070526190023.C98508@volatile.chemikals.org> References: <20070526193128.GB54875@troutmask.apl.washington.edu> <20070526214835.GS23313@hoeg.nl> <20070526224040.GA55701@troutmask.apl.washington.edu> <20070526225731.GA56181@xor.obsecurity.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-current@freebsd.org, Ed Schouten , Steve Kargl 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: Sat, 26 May 2007 23:09:20 -0000 On Sat, 26 May 2007, Kris Kennaway wrote: > On Sat, May 26, 2007 at 03:40:40PM -0700, Steve Kargl wrote: >> On Sat, May 26, 2007 at 11:48:35PM +0200, Ed Schouten wrote: >>> Hello Steve, >>> >>> * Steve Kargl wrote: >>>> mobile:kargl[234] cat a.c >>>> #include >>>> #include >>>> >>>> int main (void) { >>>> int n; >>>> float a; >>>> a = 1.f; >>>> printf("%f\n", frexpf(a,&n)); >>>> return 0; >>>> } >>>> mobile:kargl[235] cc -o z a.c -lm >>>> mobile:kargl[236] ./z >>>> 1.000000 >>>> mobile:kargl[237] cc --version >>>> cc (GCC) 4.2.0 20070514 [FreeBSD] >>>> Copyright (C) 2007 Free Software Foundation, Inc. >>>> This is free software; see the source for copying conditions. There is NO >>>> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. >>>> >>>> frexpf() should return a value in [1/2,1). >>> >>> In a different thread (about snd_emu10k1) a user noticed that -ftree-vrp >>> (part of -O2) may cause miscompilations. Could you try installing a libm >>> (src/lib/msun) that is compiled with -O1? >>> >> >> (cc'd -current list) >> >> Using -O instead of -O2 indeed appears to fix the problem. > > How about -O2 -fno-tree-vrp? > 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. -- This .signature sanitized for your protection