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

Tom Eccles via flang-commits flang-commits at lists.llvm.org
Tue Aug 4 05:40:29 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
----------------
tblah wrote:

The user might have typed -Ofast, but this will still say -ffast-math.

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


More information about the flang-commits mailing list