]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-ssa-math-opts: correct -ffp-contract= check
authorAlexander Monakov <amonakov@ispras.ru>
Wed, 17 May 2023 18:35:54 +0000 (21:35 +0300)
committerAlexander Monakov <amonakov@ispras.ru>
Wed, 17 May 2023 18:42:14 +0000 (21:42 +0300)
Since tree-ssa-math-opts may freely contract across statement boundaries
we should enable it only for -ffp-contract=fast instead of disabling it
for -ffp-contract=off.

No functional change, since -ffp-contract=on is not exposed yet.

gcc/ChangeLog:

* tree-ssa-math-opts.cc (convert_mult_to_fma): Enable only for
FP_CONTRACT_FAST (no functional change).

gcc/tree-ssa-math-opts.cc

index b58a2ac9e6a872ca5bcef53cdcd7ea169bb97d69..d71c51dc0ea2c65a875a820b106e214999698f60 100644 (file)
@@ -3320,7 +3320,7 @@ convert_mult_to_fma (gimple *mul_stmt, tree op1, tree op2,
   imm_use_iterator imm_iter;
 
   if (FLOAT_TYPE_P (type)
-      && flag_fp_contract_mode == FP_CONTRACT_OFF)
+      && flag_fp_contract_mode != FP_CONTRACT_FAST)
     return false;
 
   /* We don't want to do bitfield reduction ops.  */