Fixing the bug number Bug 52565: https://bugs.llvm.org/show_bug.cgi?id=52565
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.
Should this also imply "MathErrno = false"?
Should this conflict with -fapprox-func?
I think you need "AppoxFunc = false" here.
You need a check for "!ApproxFunc" here.
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.
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.
I am not sure what I was suggesting in my last comment is correct or not. Can one of the more experienced reviewers confirm?