From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AAEC23858C39; Mon, 6 Dec 2021 09:52:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AAEC23858C39 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/103544] [11/12 Regression] compiler crashes when trying to vectorize loop Date: Mon, 06 Dec 2021 09:52:39 +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: 11.2.0 X-Bugzilla-Keywords: ice-on-valid-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: 11.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: priority 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: Mon, 06 Dec 2021 09:52:39 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103544 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P3 |P2 --- Comment #4 from Richard Biener --- if (!single_defuse_cycle && !lane_reduc_code_p && reduction_type !=3D FOLD_LEFT_REDUCTION) { stmt_vec_info tem =3D vect_stmt_to_vectorize (STMT_VINFO_REDUC_DEF (phi_info)); if (slp_node && REDUC_GROUP_FIRST_ELEMENT (tem)) { gcc_assert (!REDUC_GROUP_NEXT_ELEMENT (tem)); tem =3D REDUC_GROUP_FIRST_ELEMENT (tem); } STMT_VINFO_DEF_TYPE (vect_orig_stmt (tem)) =3D vect_internal_def; STMT_VINFO_DEF_TYPE (tem) =3D vect_internal_def; fails to work here, because we end up visiting the reduction stmt before the reduction PHI because we have a hybrid use that makes another entry into the SLP graph, reaching the reduction stmt over the backedge. But the above relies on us doing the reduction analysis on the PHI node bef= ore the analysis of the reduction stmt.=