[flang-commits] [clang] [flang] [Flang][Driver] Override -ffast-math floating point contraction with -ffp-contract= (PR #213574)

Shunsuke Watanabe via flang-commits flang-commits at lists.llvm.org
Wed Aug 5 02:52:42 PDT 2026


================
@@ -890,6 +871,32 @@ static void addFloatingPointOptions(const Driver &D, const ArgList &Args,
     case options::OPT_fno_reciprocal_math:
       ReciprocalMath = false;
       break;
+    case options::OPT_ffp_contract: {
+      StringRef Val = A->getValue();
+      if (Val == "fast" || Val == "off") {
+        if (Val != FPContract && LastFpContractOverrideOption != "") {
+          D.Diag(clang::diag::warn_drv_overriding_option)
+              << LastFpContractOverrideOption
----------------
s-watanabe314 wrote:

Thanks for the review. I've updated the warning so that it explicitly mentions `-Ofast` when the user specifies `-Ofast`.

https://github.com/llvm/llvm-project/pull/213574


More information about the flang-commits mailing list