If the target doesn't support setting StrictFP, then ignore pragmas that modify the settings for rounding mode and exception behavior and FENV_ACCESS.
This was requested by @kpn see https://bugs.llvm.org/show_bug.cgi?id=47536
Also @pengfei suggested it as a solution for https://bugs.llvm.org/show_bug.cgi?id=47990
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Event Timeline
I also added "-fexperimental-strict-floating-point" which makes it possible to write tests for a target when bringing up the support on that target. I think it would be confusing for that flag to work on command line arguments but not pragmas.
Modified according to @kpn suggestion: if the command line has option fexperimental-strict-floating-point, the float pragmas will not be ignored.
clang/lib/Parse/ParsePragma.cpp | ||
---|---|---|
107 | Can you fix the lint issues (run the patch through clang-format)? Same for below. | |
2967 | Can you pass in PragmaName directly, or does that do unfortunate things with single quotes? | |
clang/test/Parser/pragma-fp-warn.c | ||
12–14 | I'd appreciate reversing the order of the comments so that they're in the same order as the pragmas below. |
clang/lib/Parse/ParsePragma.cpp | ||
---|---|---|
2967 | After I changed it to PragmaName, the clang-format didn't find anything to fix |
LGTM.
clang/test/Parser/pragma-fp-warn.c | ||
---|---|---|
2 | I would propose to add a line with -triple msp430. This is a simple core, it is unlikely that it gets hardware FP support. |
clang-format: please reformat the code