From owner-freebsd-current@FreeBSD.ORG Wed Sep 29 19:35:07 2010 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2ED2F1065672; Wed, 29 Sep 2010 19:35:07 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id D32248FC08; Wed, 29 Sep 2010 19:35:06 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:20e5:f9f9:5cd3:9694] (unknown [IPv6:2001:7b8:3a7:0:20e5:f9f9:5cd3:9694]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 197145C43; Wed, 29 Sep 2010 21:35:06 +0200 (CEST) Message-ID: <4CA394EB.7090902@FreeBSD.org> Date: Wed, 29 Sep 2010 21:35:07 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.11pre) Gecko/20100928 Lanikai/3.1.5pre MIME-Version: 1.0 To: Renato Botelho References: <4C99A53E.7060707@FreeBSD.org> <20100929002843.GA5001@oriental.arm.org> <4CA2E00D.3080102@FreeBSD.org> <4CA3244D.7030907@FreeBSD.org> <20100929155659.GA82433@oriental.arm.org> <20100929173158.GA73653@freebsd.org> <20100929174434.GA75072@freebsd.org> In-Reply-To: Content-Type: multipart/mixed; boundary="------------090609020204040609070302" Cc: Roman Divacky , Derek Tattersall , current@freebsd.org Subject: Re: Clang now builds world and kernel, on i386 and amd64 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: Wed, 29 Sep 2010 19:35:07 -0000 This is a multi-part message in MIME format. --------------090609020204040609070302 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 2010-09-29 20:22, Renato Botelho wrote: > It's using drand48() instead of rand() ... > GCC libc: > garga@botelhor:~/testes> ./test > random value 0.396465 > > clang libc: > garga@botelhor:~/testes> ./test > random value -inf Renato, Derek, could you please apply the attached patch for ldexp, rebuild your libc (with clang), and run your random test program again? --------------090609020204040609070302 Content-Type: text/plain; name="ldexp-amd64.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="ldexp-amd64.diff" diff --git a/lib/libc/amd64/gen/ldexp.c b/lib/libc/amd64/gen/ldexp.c index 43107fc..ecf1ff8 100644 --- a/lib/libc/amd64/gen/ldexp.c +++ b/lib/libc/amd64/gen/ldexp.c @@ -36,6 +36,8 @@ static char sccsid[] = "@(#)ldexp.c 8.1 (Berkeley) 6/4/93"; #include __FBSDID("$FreeBSD$"); +#include + /* * ldexp(value, exp): return value * (2 ** exp). * @@ -49,12 +51,16 @@ __FBSDID("$FreeBSD$"); double ldexp (double value, int exp) { - double temp, texp, temp2; + double temp, texp; +#ifdef __clang__ + volatile +#endif + double temp2; texp = exp; #ifdef __GNUC__ __asm ("fscale " - : "=u" (temp2), "=t" (temp) - : "0" (texp), "1" (value)); + : "=t" (temp), "=u" (temp2) + : "0" (value), "1" (texp)); #else #error unknown asm #endif --------------090609020204040609070302--