<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/xhtml; charset=utf-8">
</head>
<body>
<div style="font-family:sans-serif"><div style="white-space:normal">
<p dir="auto">On 25 Jun 2021, at 17:30, Kaylor, Andrew wrote:</p>

</div>
<div style="white-space:normal"><blockquote style="border-left:2px solid #3983C4; color:#3983C4; margin:0 0 5px; padding-left:5px"><p dir="auto">Hi everyone,<br>
<br>
I've been exploring clang's fp-contract behavior recently, and I see that when '-ffp-contract=fast' is used it can't be overridden with a pragma. I would have regarded this as a bug (and in fact, a bug has been filed <a href="https://bugs.llvm.org/show_bug.cgi?id=39679">https://bugs.llvm.org/show_bug.cgi?id=39679</a>). However, I've found some discussions on the mailing lists that described this as expected behavior.<br>
<br>
Last October, Sam Liu added support for a new setting ('fp-contract=fast-honor-pragmas') and updated the clang documentation to reflect the behavior of fp-contract=fast. See <a href="https://reviews.llvm.org/D90174">https://reviews.llvm.org/D90174</a>. I feel very strongly that this should have been done the other way around -- fp-contract=fast should honor pragmas and if we need an option that doesn't that could be added.<br>
<br>
In the above review, John McCall asked what "other compilers" do. Steve Canon showed that GCC doesn't honor the pragma. If I may humbly offer another  "other compiler", ICC (which doesn't distinguish between 'on' and 'fast' for fp-contract) does respect the pragma (<a href="https://godbolt.org/z/x5r9WdYb4">https://godbolt.org/z/x5r9WdYb4</a>). I'm not saying that ICC should be treated as a reference implementation over GCC or anything like that, but I am saying that its behavior strikes me as more correct than what GCC or clang currently do.<br>
<br>
Thoughts and opinions?</p>
</blockquote></div>
<div style="white-space:normal">

<p dir="auto">I don’t disagree with you in the abstract, but we consider this a GCC-designed feature.  ICC’s value as contrary precedent appears especially weak because, as you point out, they don’t really implement <code>-ffp-contract=fast</code>.</p>

<p dir="auto">There are plenty of other GCC-designed things that I don’t particularly like the design of, but where we nonetheless consider ourselves bound by their behavior.</p>

<p dir="auto">John.</p>
</div>
</div>
</body>
</html>