From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7C199385840F; Tue, 14 Sep 2021 18:28:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7C199385840F From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/98774] gcc -O3 does not vectorize some operations Date: Tue, 14 Sep 2021 18:28:40 +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: 10.2.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 18:28:40 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98774 --- Comment #5 from Andrew Pinski --- For the trunk (without -ffast-math), the perms are done too early: vect__5.32_53 =3D VEC_PERM_EXPR ; vect__5.33_54 =3D VEC_PERM_EXPR ; vect__5.34_55 =3D VEC_PERM_EXPR ; _3 =3D *mag_9(D); _58 =3D {_3, _3}; vect__4.35_59 =3D vect__5.32_53 * _58; vect__4.35_60 =3D vect__5.33_54 * _58; vect__4.35_61 =3D vect__5.34_55 * _58; With -ffast-math: a$x_1 =3D *dpos_10(D).x; a$y_11 =3D *dpos_10(D).y; _49 =3D {a$x_1, a$y_11}; _35 =3D _49 * _58; And the PERM is done too early the same way ..=