[cfe-dev] default setting of -fmath-errno
Eli Friedman
eli.friedman at gmail.com
Fri Nov 11 11:57:37 PST 2011
On Fri, Nov 11, 2011 at 3:44 AM, Jay Foad <jay.foad at gmail.com> wrote:
> Hi,
>
> I was surprised by a difference between clang and gcc. On gcc, the
> docs for -fno-math-errno say:
>
> "This option is not turned on by any -O option since it can result in
> incorrect output for programs which depend on an exact implementation
> of IEEE or ISO rules/specifications for math functions."
>
> But with clang, it seems that when I turn on any optimization (-O1 or
> higher), I *do* get the effect of -fno-math-errno. Is this
> intentional?
Yes, intentional; see http://llvm.org/bugs/show_bug.cgi?id=5971. We
should probably document it somewhere, though...
-Eli
More information about the cfe-dev
mailing list