RFC: -ffp-contract default value

Now that ⚙ D136080 [flang] Add -ffp-contract option processing has landed, we have an -ffp-contract flag in Flang. The flag doesn’t do anything yet, but will eventually control whether the contract attribute is added to LLVM IR for floating point operations.

Currently the default value is off, meaning that the attribute will not be added. However, gfortran defaults to “fast” (see Optimize Options (Using the GNU Compiler Collection (GCC))).

Should the default be changed to “fast” to match gfortran?

Similar discussion for clang is here: FP contraction (FMA) on by default

1 Like

I think when lowering support is added it would be good to set the default to fast to match the gfortran settting.

FWIW, the Intel compiler and the armflang compiler (based on classic-flang) also sets -ffp-contract to fast by default.