Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Feb 2011 13:45:31 -0500
From:      David Schultz <das@freebsd.org>
To:        Roman Divacky <rdivacky@freebsd.org>
Cc:        "Pedro F. Giffuni" <giffunip@yahoo.com>, freebsd-toolchain@freebsd.org
Subject:   Re: -fno-math-errno by default
Message-ID:  <20110207184531.GA81963@zim.MIT.EDU>
In-Reply-To: <20110207175454.GA52746@freebsd.org>
References:  <alpine.LNX.2.00.1102062007490.8943@gerinyyl> <20110207175454.GA52746@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110207184531.GA81963>