From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1572339960E0; Thu, 17 Nov 2022 13:16:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1572339960E0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668690996; bh=Ss3qavbvo99za11CKhUugW3e/HRqjlwj1MB/DjICw6s=; h=From:To:Subject:Date:In-Reply-To:References:From; b=OkkIOUoGqlYzVC6jArVIG9a71Yb5VhdJZ3h59uqVjQ9tIdJmN6TzsI4DhVm9Hjmy4 KfHbyQhhFownYNb+sWPHgZrnX8UA+e7t6tjbdb0hhTWGvEq/MUqJbPSSmb8OUk+DCa 7eSGA0wpH5TVjkFXkJ24QFliA7EmmV4ovtX1S+RY= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/107647] [12/13 Regression] GCC 12.2.0 may produce FMAs even with -ffp-contract=off Date: Thu, 17 Nov 2022 13:16:35 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 12.2.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107647 --- Comment #16 from Richard Biener --- (In reply to Alexander Monakov from comment #15) > I'm confused about the first hunk in the attached patch: >=20 > --- 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 left_op, right_op; > slp_tree add0 =3D NULL; >=20=20 > - /* 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=3Dfast. */ > if (!mul0 > + && flag_fp_contract_mode !=3D FP_CONTRACT_FAST > && vect_match_expression_p (l0node[0], PLUS_EXPR)) > { > auto vals =3D SLP_TREE_CHILDREN (l0node[0]); >=20 >=20 > Shouldn't it be ' =3D=3D FP_CONTRACT_FAST' rather than '!=3D'? It seems w= e are > checking that a match is found and contracting across statement boundaries > is allowed. whoops yes, I'll fix and add a check for the type.=