From owner-freebsd-toolchain@FreeBSD.ORG Sun Feb 6 19:40:44 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54FCA1065679 for ; Sun, 6 Feb 2011 19:40:44 +0000 (UTC) (envelope-from gerald@pfeifer.com) Received: from relay02.pair.com (relay02.pair.com [209.68.5.16]) by mx1.freebsd.org (Postfix) with SMTP id E52A78FC08 for ; Sun, 6 Feb 2011 19:40:43 +0000 (UTC) Received: (qmail 5574 invoked from network); 6 Feb 2011 19:40:41 -0000 Received: from 2.205.204.203 (HELO ip-2-205-204-203.web.vodafone.de) (2.205.204.203) by relay02.pair.com with SMTP; 6 Feb 2011 19:40:41 -0000 X-pair-Authenticated: 2.205.204.203 Date: Sun, 6 Feb 2011 20:40:41 +0100 (CET) From: Gerald Pfeifer To: freebsd-toolchain@freebsd.org, David Schultz Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: "Pedro F. Giffuni" Subject: -fno-math-errno by default X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Feb 2011 19:40:44 -0000 Pedro kindly made me aware of http://svn.freebsd.org/viewvc/base?view=revision&revision=181538 where David made -fno-math-errno the default for GCC with the following background: Our libm doesn't support the SysV mistake of setting errno, and never has. This will need to be fixed upstream in a more generic way, but the changes are somewhat more involved. Do I understand correctly that libm on all versions of FreeBSD and on all platforms does not set errno, so this should become the default for FreeBSD also upstream? It would have been nice to report this upstream (and apologies if you did and it got missed) and I'll try to raise it there, but wanted to get confirmation first. Thanks, Gerald @FreeBSD.org From owner-freebsd-toolchain@FreeBSD.ORG Sun Feb 6 20:24:27 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DA9E106566B for ; Sun, 6 Feb 2011 20:24:27 +0000 (UTC) (envelope-from giffunip@tutopia.com) Received: from nm20.bullet.mail.sp2.yahoo.com (nm20.bullet.mail.sp2.yahoo.com [98.139.91.90]) by mx1.freebsd.org (Postfix) with SMTP id 35C438FC14 for ; Sun, 6 Feb 2011 20:24:27 +0000 (UTC) Received: from [98.139.91.67] by nm20.bullet.mail.sp2.yahoo.com with NNFMP; 06 Feb 2011 20:11:46 -0000 Received: from [98.139.91.59] by tm7.bullet.mail.sp2.yahoo.com with NNFMP; 06 Feb 2011 20:11:45 -0000 Received: from [127.0.0.1] by omp1059.mail.sp2.yahoo.com with NNFMP; 06 Feb 2011 20:11:45 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 961443.50562.bm@omp1059.mail.sp2.yahoo.com Received: (qmail 26052 invoked by uid 60001); 6 Feb 2011 20:11:45 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1297023105; bh=P1w0JBZsiWZqrUSavMyaWvgFEw8B1jOrYmvJgS6tdqc=; h=Message-ID:X-YMail-OSG:Received:X-RocketYMMF:X-Mailer:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=r6s0JMXOq0E2QWTsdV9n0tXJUDnjss0NGU+1j8vtXJIZ4H/gM0r6CZkl4n/vTdDLgF8knD1UmEEWrgXUo/aCTf/Xe/qW+/s+c43ksa7qpqf5cDzpGS0eer4Swg8dTgAbcEy7qrJFzOkeYMOQOjOrnKrMtTL968cOTOUsDbFpuWA= Message-ID: <537963.24371.qm@web113512.mail.gq1.yahoo.com> X-YMail-OSG: kaSogbkVM1kvCO3j9F7ZUo2x5HSx.yONht_cvUqGFRKmfUo SQRuTZAT71yrj3QjsWSFCIBeA2.XT5JomB35gY8jDpMU7gLqgD59FF8i.O6f wZ4h6n_7vJ83uzYN.otRuHFyFCsY6rI.dPuiykB0_5ge1hQCZPKSm5f1..B_ Q8M5o_a0Uh2fnOA1Puw2N5sufY_s9lcd1UIcqgF.ptNLTbt4xobxxXe2ohtg .iRUAuOSEQMEEBFVF8TaKGb4NfvHEJg44T2f_wboNhBcE0G9fIamjIdIHc5w mKT53fD7e4sikG5NamInv_dLheO14dVSY5ZiyypZXJS4DBrksRrFkkJZ0sB2 F2_bQt2jdE0qFDIA22chsO.nUnfBe6JPbBsH1luaq4rKfRCmyA_C5XJFRqcq 8rsl1fslqNbbnbQ-- Received: from [190.157.140.248] by web113512.mail.gq1.yahoo.com via HTTP; Sun, 06 Feb 2011 12:11:45 PST X-RocketYMMF: giffunip X-Mailer: YahooMailClassic/11.4.20 YahooMailWebService/0.8.108.291010 Date: Sun, 6 Feb 2011 12:11:45 -0800 (PST) From: "Pedro F. Giffuni" To: freebsd-toolchain@freebsd.org, David Schultz , Gerald Pfeifer In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Subject: Re: -fno-math-errno by default X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: giffunip@tutopia.com List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Feb 2011 20:24:27 -0000 =0A--- On Sun, 2/6/11, Gerald Pfeifer wrote:=0A...=0A>= =0A> =A0 http://svn.freebsd.org/viewvc/base?view=3Drevision&revision=3D181= 538=0A> =0A> where David made -fno-math-errno the default for GCC with=0A..= .=0A> =0A> Do I understand correctly that libm on all versions of=0A> FreeB= SD and on all platforms does not set errno, so this=0A> should become the d= efault for FreeBSD also upstream?=0A> =0A=0AThat is my understanding of the= commit too, so I guess=0A"configure" should do a better job detecting this= .=0A=0AThat said, I don't know if setting errno is good or=0Abad: Apple's g= cc has this:=0A=0A----=0A; APPLE LOCAL begin optimization pragmas 3124235/3= 420242=0Afmath-errno=0ACommon Report Var(flag_errno_math) Init(1) PerFunc= =0ASet errno after built-in math functions=0A; APPLE LOCAL end optimization= pragmas 3124235/3420242=0A----=0A=0AI have no idea what the origin of thei= r math stuff is=0Abut apparently they saw a value of using the sysv approac= h.=0A=0A> It would have been nice to report this upstream (and=0A> apologie= s if you did and it got missed) and I'll try=0A> to raise it there, but wan= ted to get confirmation=0A> first.=0A>=0ANo, I didn't ... thanks for bringi= ng this up in=0Afreebsd-toolchain though, there may be a similar issue=0Awi= th clang.=0A =0Acheers,=0A=0APedro.=0A=0A=0A From owner-freebsd-toolchain@FreeBSD.ORG Sun Feb 6 22:30:03 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F2051065674 for ; Sun, 6 Feb 2011 22:30:03 +0000 (UTC) (envelope-from das@freebsd.org) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 083138FC18 for ; Sun, 6 Feb 2011 22:30:02 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.4/8.14.2) with ESMTP id p16MDZdk077016; Sun, 6 Feb 2011 17:13:35 -0500 (EST) (envelope-from das@freebsd.org) Received: (from das@localhost) by zim.MIT.EDU (8.14.4/8.14.2/Submit) id p16MDZJx077015; Sun, 6 Feb 2011 17:13:35 -0500 (EST) (envelope-from das@freebsd.org) Date: Sun, 6 Feb 2011 17:13:35 -0500 From: David Schultz To: Gerald Pfeifer Message-ID: <20110206221335.GA76984@zim.MIT.EDU> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Cc: "Pedro F. Giffuni" , freebsd-toolchain@freebsd.org Subject: Re: -fno-math-errno by default X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Feb 2011 22:30:03 -0000 On Sun, Feb 06, 2011, Gerald Pfeifer wrote: > Pedro kindly made me aware of > > http://svn.freebsd.org/viewvc/base?view=revision&revision=181538 > > where David made -fno-math-errno the default for GCC with the following > background: > > Our libm doesn't support the SysV mistake of setting errno, and never > has. This will need to be fixed upstream in a more generic way, but > the changes are somewhat more involved. > > Do I understand correctly that libm on all versions of FreeBSD and on > all platforms does not set errno, so this should become the default for > FreeBSD also upstream? That is correct. Basically nobody sets errno in the math library anymore, except for compatibility with old apps written for the System V math library. BSD never has and never will. IEEE 754 floating point exception flags are much saner and faster. > It would have been nice to report this upstream (and apologies if you > did and it got missed) and I'll try to raise it there, but wanted to > get confirmation first. I submitted a change request to gcc about 2.5 years ago: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37073 From owner-freebsd-toolchain@FreeBSD.ORG Mon Feb 7 01:57:45 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE35A1065670 for ; Mon, 7 Feb 2011 01:57:45 +0000 (UTC) (envelope-from gerald@pfeifer.com) Received: from relay00.pair.com (relay00.pair.com [209.68.5.9]) by mx1.freebsd.org (Postfix) with SMTP id 885D38FC0A for ; Mon, 7 Feb 2011 01:57:45 +0000 (UTC) Received: (qmail 76783 invoked from network); 7 Feb 2011 01:57:44 -0000 Received: from 2.205.204.203 (HELO ip-2-205-204-203.web.vodafone.de) (2.205.204.203) by relay00.pair.com with SMTP; 7 Feb 2011 01:57:44 -0000 X-pair-Authenticated: 2.205.204.203 Date: Mon, 7 Feb 2011 02:57:47 +0100 (CET) From: Gerald Pfeifer To: David Schultz In-Reply-To: <20110206221335.GA76984@zim.MIT.EDU> Message-ID: References: <20110206221335.GA76984@zim.MIT.EDU> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: "Pedro F. Giffuni" , freebsd-toolchain@freebsd.org Subject: Re: -fno-math-errno by default X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Feb 2011 01:57:46 -0000 On Sun, 6 Feb 2011, David Schultz wrote: > That is correct. Basically nobody sets errno in the math library > anymore, except for compatibility with old apps written for the > System V math library. BSD never has and never will. IEEE 754 > floating point exception flags are much saner and faster. Thanks for the confirmation, David! > I submitted a change request to gcc about 2.5 years ago: > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37073 Uh, that's not good. That is, you did the right thing, just Loren as the upstream FreeBSD maintainer must have missed it somehow. I'll see what I can do about it. (I also checked, and this plus the one on -mfancy-math-387 are the only open issues from someone @freebsd.org.) Gerald From owner-freebsd-toolchain@FreeBSD.ORG Mon Feb 7 03:03:04 2011 Return-Path: Delivered-To: freebsd-toolchain@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63A78106566B; Mon, 7 Feb 2011 03:03:04 +0000 (UTC) (envelope-from bf1783@googlemail.com) Received: from mail-yw0-f54.google.com (mail-yw0-f54.google.com [209.85.213.54]) by mx1.freebsd.org (Postfix) with ESMTP id F276B8FC12; Mon, 7 Feb 2011 03:03:03 +0000 (UTC) Received: by ywp6 with SMTP id 6so1651945ywp.13 for ; Sun, 06 Feb 2011 19:03:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:reply-to:date:message-id:subject :from:to:cc:content-type; bh=xqo3p97fZ4eoBM+A9WlkzeKB2BfAM61Z4tdytuM4yUo=; b=JjgnDurQb0ApNCmbcgEBZ5SVwsIS452ap30cdx3CHtU3tpk7liUvU+LnXkPvHtzqyn oFiVXaTXkdZvLnZXatcO/j7Lh/mgQuV8CUNiEpV1u95iZ5lyqmCK7VKQHuNzmWQ12xZU umqsYGlgEKNDJIpB6uWm9x/RV3lcvA9q7pqvA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:reply-to:date:message-id:subject:from:to:cc :content-type; b=teh9jwQnKv5h3zZPw0E/iKlgpu7Sv2fg0aca81ta/Hq/vvz2niB1g2kcmmAhYdqZDI DctdL9rPq5X829fixGDndJ4SfT4cl8VPReXn5/+6YWzupurOcplMmRapNT1Cj53uRuHy rV9knR2Kp+yKlQ/c12YB/kywKHJuaSiLhTGwk= MIME-Version: 1.0 Received: by 10.236.105.200 with SMTP id k48mr1272529yhg.89.1297047783138; Sun, 06 Feb 2011 19:03:03 -0800 (PST) Received: by 10.236.110.52 with HTTP; Sun, 6 Feb 2011 19:03:03 -0800 (PST) Date: Sun, 6 Feb 2011 22:03:03 -0500 Message-ID: From: "b. f." To: David Schultz Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-toolchain@FreeBSD.org, gerald@FreeBSD.org Subject: Re: -fno-math-errno by default X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: bf1783@gmail.com List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Feb 2011 03:03:04 -0000 > On Sun, Feb 06, 2011, Gerald Pfeifer wrote: > > Pedro kindly made me aware of > > > > http://svn.freebsd.org/viewvc/base?view=revision&revision=181538 > > > > where David made -fno-math-errno the default for GCC with the following > > background: > > > > Our libm doesn't support the SysV mistake of setting errno, and never > > has. This will need to be fixed upstream in a more generic way, but > > the changes are somewhat more involved. > > > > Do I understand correctly that libm on all versions of FreeBSD and on > > all platforms does not set errno, so this should become the default for > > FreeBSD also upstream? > > That is correct. Basically nobody sets errno in the math library > anymore, except for compatibility with old apps written for the > System V math library. BSD never has and never will. IEEE 754 > floating point exception flags are much saner and faster. > > > It would have been nice to report this upstream (and apologies if you > > did and it got missed) and I'll try to raise it there, but wanted to > > get confirmation first. > > I submitted a change request to gcc about 2.5 years ago: > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37073 But if I remember correctly, you didn't add it to the default CFLAGS and FFLAGS used on FreeBSD, because you either suspected or knew that it would incur additional overhead when using the compiler and not actually needing libm. Is that the case, or should we just add it to the default flags? I did so on my system at home, but I didn't measure if there was a penalty. b. From owner-freebsd-toolchain@FreeBSD.ORG Mon Feb 7 17:54:58 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4204B106566C for ; Mon, 7 Feb 2011 17:54:58 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (lev.vlakno.cz [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id ED9DF8FC1E for ; Mon, 7 Feb 2011 17:54:57 +0000 (UTC) Received: from lev.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id CD3CA9CB0D4; Mon, 7 Feb 2011 18:54:55 +0100 (CET) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by lev.vlakno.cz (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QydWH+ptL6DU; Mon, 7 Feb 2011 18:54:55 +0100 (CET) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 37C7C9CB12F; Mon, 7 Feb 2011 18:54:55 +0100 (CET) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.4/8.14.4/Submit) id p17HssuH052848; Mon, 7 Feb 2011 18:54:54 +0100 (CET) (envelope-from rdivacky) Date: Mon, 7 Feb 2011 18:54:54 +0100 From: Roman Divacky To: Gerald Pfeifer Message-ID: <20110207175454.GA52746@freebsd.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: "Pedro F. Giffuni" , David Schultz , freebsd-toolchain@freebsd.org Subject: Re: -fno-math-errno by default X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Feb 2011 17:54:58 -0000 should clang follow the same and default to -fno-math-errno on FreeBSD? I guess so but I want to be sure, thank you! roman On Sun, Feb 06, 2011 at 08:40:41PM +0100, Gerald Pfeifer wrote: > Pedro kindly made me aware of > > http://svn.freebsd.org/viewvc/base?view=revision&revision=181538 > > where David made -fno-math-errno the default for GCC with the following > background: > > Our libm doesn't support the SysV mistake of setting errno, and never > has. This will need to be fixed upstream in a more generic way, but > the changes are somewhat more involved. > > Do I understand correctly that libm on all versions of FreeBSD and on > all platforms does not set errno, so this should become the default for > FreeBSD also upstream? > > It would have been nice to report this upstream (and apologies if you > did and it got missed) and I'll try to raise it there, but wanted to > get confirmation first. > > Thanks, > Gerald @FreeBSD.org > _______________________________________________ > freebsd-toolchain@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain > To unsubscribe, send any mail to "freebsd-toolchain-unsubscribe@freebsd.org" From owner-freebsd-toolchain@FreeBSD.ORG Mon Feb 7 18:45:32 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FBC8106564A for ; Mon, 7 Feb 2011 18:45:32 +0000 (UTC) (envelope-from das@freebsd.org) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 69AC28FC08 for ; Mon, 7 Feb 2011 18:45:32 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.4/8.14.2) with ESMTP id p17IjV7L082042; Mon, 7 Feb 2011 13:45:31 -0500 (EST) (envelope-from das@freebsd.org) Received: (from das@localhost) by zim.MIT.EDU (8.14.4/8.14.2/Submit) id p17IjV0D082041; Mon, 7 Feb 2011 13:45:31 -0500 (EST) (envelope-from das@freebsd.org) Date: Mon, 7 Feb 2011 13:45:31 -0500 From: David Schultz To: Roman Divacky Message-ID: <20110207184531.GA81963@zim.MIT.EDU> References: <20110207175454.GA52746@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110207175454.GA52746@freebsd.org> Cc: "Pedro F. Giffuni" , freebsd-toolchain@freebsd.org Subject: Re: -fno-math-errno by default X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Feb 2011 18:45:32 -0000 On Mon, Feb 07, 2011, Roman Divacky wrote: > should clang follow the same and default to -fno-math-errno > on FreeBSD? > > I guess so but I want to be sure, thank you! Yes. All the flag does, at least in gcc, is inform the compiler that we don't have an old System V-style math library that sets errno instead of using floating point exception flags. The flag affects the way gcc handles built-in math functions. For instance, with -fno-math-errno, gcc is able to inline sqrt(x) into a single instruction. Without the flag, however, gcc wrongly assumes that sqrt(3) might set errno, so it generates extra code to check the sign of x and call the math library if x is negative.