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.