From owner-freebsd-numerics@FreeBSD.ORG Sat Aug 10 02:42:13 2013 Return-Path: Delivered-To: freebsd-numerics@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9ACFBDF1 for ; Sat, 10 Aug 2013 02:42:13 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7A80B21DF for ; Sat, 10 Aug 2013 02:42:13 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.7/8.14.7) with ESMTP id r7A2g13R062825; Fri, 9 Aug 2013 19:42:01 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.7/8.14.7/Submit) id r7A2g0Vh062824; Fri, 9 Aug 2013 19:42:01 -0700 (PDT) (envelope-from sgk) Date: Fri, 9 Aug 2013 19:42:00 -0700 From: Steve Kargl To: Zimmermann Paul Subject: Re: help requested with long double issue on 32-bit FreeBSD Message-ID: <20130810024200.GA62686@troutmask.apl.washington.edu> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-numerics@freebsd.org X-BeenThere: freebsd-numerics@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of high quality implementation of libm functions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Aug 2013 02:42:13 -0000 On Fri, Aug 09, 2013 at 09:44:25PM +0200, Zimmermann Paul wrote: > > [this mail was sent on the MPFR list, but Steve Kargl suggested to post it > also here] > > we need help to investigate an error we get with the development version of > MPFR on i686-freebsd. The error occurs on the hydra.nixos.org continuous > integration platform. Unfortunately we don't have direct access to the > corresponding computer, thus isolating the issue is not easy. > > The error we get can be seen at http://hydra.nixos.org/build/5666171/log/raw. > Starting from the long double value in 3, and subtracting e=0.25, we get the > long double value in 4, which is obviously wrong in the last bits: > > 3: d=2.632048527199790448306230411512629530e-01 > 4: d=1.320485271997904469509776959057489876e-02 > ^^^^^^^^^^^^^^^^^^^^ > > We believe this is a compiler bug (GCC 4.2.1 was used in this test). > > If you have access to a 32-bit computer under FreeBSD, please could you try > to compile the development version and run the "tset_ld" test, after doing > export GMP_CHECK_RANDOMIZE=1376689137? > > If you can reproduce the error, please tell Vincent Lef??vre and myself > (Vincent.Lefevre at ens-lyon.fr and Paul.Zimmermann at inria.fr); we'll help > you to isolate the problem (e.g., trying different optimization levels). > > If you can't reproduce (on a 32-bit FreeBSD machine), please tell us too; > this might indicate the bug was fixed in a later gcc version. I see the issue on my system. With a trivial program, #include int main(void) { long double d, e, r; d = 2.632048527199790448306230411512629530e-01L; e = 0.25L; r = d - e; printf("%.25Le\n", d); printf(" %.25Le\n", r); printf(" %.25Le\n", d - e); printf(" 32048527199790448306230411512629530\n"); return (0); } I see % ~/work/bin/gcc -o z a.c && ./z 2.6320485271997906551177948e-01 1.3204852719979065511779481e-02 1.3204852719979065511779481e-02 32048527199790448306230411512629530 I get these results with 4.2.1, 4.6.3, and 4.9.0. -- Steve