From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8B8DE383B80B; Wed, 11 Aug 2021 08:40:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8B8DE383B80B From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/101861] [12 Regression] ICE (segfault) via tree-vect-stmts.c:9495's vectorizable_load Date: Wed, 11 Aug 2021 08:40:13 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 12.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: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.0 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: Wed, 11 Aug 2021 08:40:13 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101861 --- Comment #2 from Richard Biener --- OK, so we're having memory_access_type =3D=3D VMAT_GATHER_SCATTER, gs_info.= ifn !=3D IFN_LAST but STMT_VINFO_GATHER_SCATTER_P is false. It looks like vec_offse= t is set elsewhere in that case. Likely here: else if (memory_access_type =3D=3D VMAT_GATHER_SCATTER) { aggr_type =3D elem_type; vect_get_strided_load_store_ops (stmt_info, loop_vinfo, &gs_info, &bump, &vec_offset); } so the fix is to re-instante the guard, doing diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index ab402b57fb4..cc6c091e41e 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -9492,7 +9492,8 @@ vectorizable_load (vec_info *vinfo, if (memory_access_type =3D=3D VMAT_GATHER_SCATTER && gs_info.ifn !=3D IFN_LAST) { - vec_offset =3D vec_offsets[j]; + if (STMT_VINFO_GATHER_SCATTER_P (stmt_info)) + vec_offset =3D vec_offsets[j]; tree zero =3D build_zero_cst (vectype); tree scale =3D size_int (gs_info.scale); gcall *call; will push this as obvious.=