[cfe-dev] ffp-model=fast ignores #pragma STDC FP_CONTRACT OFF

Ammarguellat, Zahira via cfe-dev cfe-dev at lists.llvm.org
Tue Oct 26 06:10:06 PDT 2021


Hi All,

Using option ffp-model=fast and #pragma STDC FP_CONTRACT OFF doesn't have the expected clang's behavior of pragmas.

See for example https://godbolt.org/z/PYYd5zd4Pthis The pragma is honored; FMA instructions are generated following the option and are suppressed as directed by the pragma at codegen.

In contrast, https://godbolt.org/z/WvvaKrv1b shows that the option -ffp-model=fast is honored in the FE, but the pragma is ignored. The LLVM IR generated is correct, but codegen doesn't honor the pragma as expected. Although this seems to be "historically" (codegen didn't used to get fast-math flags so a global option was used; now codegen sees these flags) the pragma should be honored. This should be filed as a bug.
Thoughts?

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20211026/ceb62938/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 69751 bytes
Desc: image001.gif
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20211026/ceb62938/attachment-0001.gif>


More information about the cfe-dev mailing list