From owner-freebsd-current Thu Oct 31 3:26:40 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E627B37B401 for ; Thu, 31 Oct 2002 03:26:38 -0800 (PST) Received: from HAL9000.homeunix.com (12-232-220-15.client.attbi.com [12.232.220.15]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2C12843E88 for ; Thu, 31 Oct 2002 03:26:38 -0800 (PST) (envelope-from dschultz@uclink.Berkeley.EDU) Received: from HAL9000.homeunix.com (localhost [127.0.0.1]) by HAL9000.homeunix.com (8.12.6/8.12.5) with ESMTP id g9VBQOTx028195; Thu, 31 Oct 2002 03:26:24 -0800 (PST) (envelope-from dschultz@uclink.Berkeley.EDU) Received: (from das@localhost) by HAL9000.homeunix.com (8.12.6/8.12.5/Submit) id g9VBQNjt028194; Thu, 31 Oct 2002 03:26:23 -0800 (PST) (envelope-from dschultz@uclink.Berkeley.EDU) Date: Thu, 31 Oct 2002 03:26:23 -0800 From: David Schultz To: Bruce Evans Cc: "M. Warner Losh" , tlambert2@mindspring.com, rittle@labs.mot.com, rittle@latour.rsch.comm.mot.com, current@FreeBSD.ORG Subject: Re: Lack of real long double support Message-ID: <20021031112623.GA28135@HAL9000.homeunix.com> Mail-Followup-To: Bruce Evans , "M. Warner Losh" , tlambert2@mindspring.com, rittle@labs.mot.com, rittle@latour.rsch.comm.mot.com, current@FreeBSD.ORG References: <20021030.170154.35505346.imp@bsdimp.com> <20021031202343.W8632-100000@gamplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20021031202343.W8632-100000@gamplex.bde.org> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Thus spake Bruce Evans : > $ cc -o z z.c > $ ./z > LDBL_EPSILON failed test 1 with prec 2 > $ cc -O -o z z.c. > $ ./z > LDBL_EPSILON failed test 1 with prec 2 > DBL_EPSILON failed test 2 with prec 3 > %%% > > The full brokenness only shows up with -O. Actually, the _full_ brokenness of floating point in FreeBSD shows up only with -O2. :-( A number of library functions (e.g. isinf()) use unions for type punning, which violates C's aliasing rules. It turns out that there's a bad interaction between gcc3's -fschedule-insns and -fstrict-aliasing (both implied by -O2) that can cause problems. The best fix I know of is to use unions in the limited way that gcc's optimizer knows how to handle in a reasonable way. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message