From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CE9E0385780E; Mon, 14 Sep 2020 09:16:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CE9E0385780E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1600074980; bh=1UnaeKEj0/HcUcpyj9/2pJHIjk30O/QqVAWYHOWulk4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=B8UniSasQ74B3yKzfkfDULOQuVtksMAWWesY72q5CBgt83+nXjKYL172ZgwRqHKhZ ROrWvmYapmvk8PAA6itQE4BeRBWl+5Vi/gGdM6wGRskh8JIVnuap46mV8dLITFIdWA kIp1x5CHDcw6mPe7TRwFZQt69U/ZhwARgUjLUN2I= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/97043] latent wrong-code with SLP vectorization Date: Mon, 14 Sep 2020 09:16:20 +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.1 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth 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: keywords everconfirmed blocked bug_status cf_reconfirmed_on 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, 14 Sep 2020 09:16:20 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97043 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |wrong-code Ever confirmed|0 |1 Blocks| |96522 Status|UNCONFIRMED |NEW Last reconfirmed| |2020-09-14 --- Comment #1 from Richard Biener --- This blocks backporting the fix for PR96522, causing the gcc.dg/vect/pr8141= 0.c testcase to FAIL execution with an unaligned access using an aligned load. The trunk rev. that fixed this is gbc484e250990393e887f7239157cc85ce6fadcce A pragmatic fix might be diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c index f6331eeea86..3fdf56f9335 100644 --- a/gcc/tree-vect-slp.c +++ b/gcc/tree-vect-slp.c @@ -2309,9 +2309,8 @@ vect_analyze_slp_instance (vec_info *vinfo, /* The load requires permutation when unrolling exposes a gap either because the group is larger than the SLP group-size or because there is a gap between the group= s.=20 */ - && (known_eq (unrolling_factor, 1U) - || (group_size =3D=3D DR_GROUP_SIZE (first_stmt_info) - && DR_GROUP_GAP (first_stmt_info) =3D=3D 0))) + && group_size =3D=3D DR_GROUP_SIZE (first_stmt_info) + && DR_GROUP_GAP (first_stmt_info) =3D=3D 0) { SLP_TREE_LOAD_PERMUTATION (load_node).release (); continue; with biggest effects eventually on load-lane targets (arm/aarch64) where we then eventually prefer more of those. For the testcase in question we then generate the following, matching trunk movdqa (%rdx), %xmm2 movdqa 16(%rdx), %xmm0 shufpd $1, 32(%rdx), %xmm0 instead of movdqa (%rdx), %xmm1 addq $48, %rdx movdqu -24(%rdx), %xmm2 (or with the backport of PR96522 a wrong movdqa in place of the movdqu). Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96522 [Bug 96522] [9/10 Regression] Incorrect with with -O -fno-tree-pta=