Fixing the bug number Bug 52565: https://bugs.llvm.org/show_bug.cgi?id=52565
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Thanks for the patch! This looks mostly good. I have just a few suggestions.
Could you add test cases in clang/test/Driver/clang_f_opts.c to verify that the various driver inputs get overridden in the expected way? Without such a test, this behavior is likely to be broken in the future.
clang/lib/Driver/ToolChains/Clang.cpp | ||
---|---|---|
2760 | Should this also imply "MathErrno = false"? | |
2762 | Should this conflict with -fapprox-func? | |
2880 | I think you need "AppoxFunc = false" here. | |
2938 | You need a check for "!ApproxFunc" here. |
Updated the test combining -ffast-math and -fno-approx-func options.
@andrew.w.kaylor I hope you don't mind that I put those tests on clang/test/Driver/fast-math.c instead.
clang/lib/Driver/ToolChains/Clang.cpp | ||
---|---|---|
2760 | I don't think setting ApproxFunc to true should imply "MathErrno = false". Let say someone have a math library that compute approximate result for none special input/output but returns NaN, INF and errno correctly otherwise. That is actually can be fairly common, because performance in the none special cases are much more important that the special ones. So returning errno in the special outputs theoretically should not effect the performance on the main path. Therefore, I think compiler should not assume anything about MathErrno value based on ApproxFunc value. | |
2762 | Same as above. |
Removing myself as a reviewer because this is just far enough outside my expertise to feel uncomfortable reviewing it, but added a few trusted folks who have expressed opinions in this area before.
clang/lib/Driver/ToolChains/Clang.cpp | ||
---|---|---|
2760 | I am not sure what I was suggesting in my last comment is correct or not. Can one of the more experienced reviewers confirm? |
clang/lib/Driver/ToolChains/Clang.cpp | ||
---|---|---|
2760 | They seem pretty orthogonal to me. |
A gentle reminder for reviewers. -- This patch will fix the bug reported here: https://bugs.llvm.org/show_bug.cgi?id=52565
lgtm
clang/lib/Driver/ToolChains/Clang.cpp | ||
---|---|---|
2760 | I see the point of your explanation. I'm satisfied that they should remain separate. |
Should this also imply "MathErrno = false"?