From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 97623385841D; Tue, 28 Nov 2023 12:10:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 97623385841D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1701173407; bh=2JW2UPJp1R6ymbFnEiUaxv/8oOSWYz6P93FKO0zaF+8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=xfXJSAyh4LO5tl0xgnJ0/ilC5AMNNfqBTU4zQM9rDZ2s2A0dHobQh9cgpYgvVzwEs o8ag6mhQrdUzOzxXXz1ZFTMc0Qd3Mh2MaqRcefyXseDBm2Otn4nvPysj/Jp050jbqK 2S7L3IYkoqvZJkRnq3WAbxGgS1AEqnfW/QUWxiG8= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/112736] [14 Regression] vectorizer is introducing out of bounds memory access Date: Tue, 28 Nov 2023 12:10:06 +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: 14.0 X-Bugzilla-Keywords: needs-bisection, 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: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status assigned_to 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=3D112736 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot = gnu.org --- Comment #2 from Richard Biener --- The vectorizer sees [local count: 214748368]: # a.3_5 =3D PHI <_2(5), 2(2)> # ivtmp_9 =3D PHI _14 =3D b[a.3_5]; c[a.3_5][0] =3D _14; c[a.3_5][1] =3D _14; c[a.3_5][2] =3D _14; c[a.3_5][3] =3D _14; _2 =3D a.3_5 + -1; ivtmp_3 =3D ivtmp_9 - 1; if (ivtmp_3 !=3D 0) goto ; [89.00%] else goto ; [11.00%] [local count: 191126048]: goto ; [100.00%] and uses SLP, this is likely caused by my patch to allow non-grouped-loads there. t.c:7:17: note: node 0x4637048 (max_nunits=3D4, refcnt=3D1) vector(4) int t.c:7:17: note: op template: _14 =3D b[a.3_5]; t.c:7:17: note: stmt 0 _14 =3D b[a.3_5]; t.c:7:17: note: stmt 1 _14 =3D b[a.3_5]; t.c:7:17: note: stmt 2 _14 =3D b[a.3_5]; t.c:7:17: note: stmt 3 _14 =3D b[a.3_5]; t.c:7:17: note: load permutation { 0 0 0 0 } I think we need to force strided-SLP for them.=