https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107647
--- Comment #15 from Alexander Monakov <amonakov at gcc dot gnu.org> --- I'm confused about the first hunk in the attached patch: --- a/gcc/tree-vect-slp-patterns.cc +++ b/gcc/tree-vect-slp-patterns.cc @@ -1035,8 +1035,10 @@ complex_mul_pattern::matches (complex_operation_t op, auto_vec<slp_tree> left_op, right_op; slp_tree add0 = NULL; - /* Check if we may be a multiply add. */ + /* Check if we may be a multiply add. It's only valid to form FMAs + with -ffp-contract=fast. */ if (!mul0 + && flag_fp_contract_mode != FP_CONTRACT_FAST && vect_match_expression_p (l0node[0], PLUS_EXPR)) { auto vals = SLP_TREE_CHILDREN (l0node[0]); Shouldn't it be ' == FP_CONTRACT_FAST' rather than '!='? It seems we are checking that a match is found and contracting across statement boundaries is allowed.