[cfe-dev] default setting of -fmath-errno

Jay Foad jay.foad at gmail.com
Wed Nov 30 07:25:37 PST 2011


On 11 November 2011 19:57, Eli Friedman <eli.friedman at gmail.com> wrote:
> 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...

This seems like a poor decision since (as it says in the GCC docs
quoted above) -fno-math-errno can break valid programs. What's the
rationale? The bug report doesn't really explain much.

Thanks,
Jay.




More information about the cfe-dev mailing list