From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F38F43858CDB; Wed, 17 Jan 2024 08:48:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F38F43858CDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1705481340; bh=pPObHV4NrCndYi4PQmpFVxiTmR6zxPlzYggpHajGkjU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=qcOvhjMILk4cz9d4SksLw6fE4j35mC2zU1k9bJm6bao/2k1EkA8za0u2sKQi7iGdZ skn6O4wY4oA5RTpRrInKQZrcMSIeObJfD60/zrOloF/JfwLsaz3LJGgTRELGVxX063 UOKkxLPLdFHwfZvuwECmd83tXtHkI15TmLNhTFPY= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/113431] [14 Regression] Wrong code at -O3 Date: Wed, 17 Jan 2024 08:48:55 +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: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D113431 --- Comment #12 from Richard Biener --- (In reply to JuzheZhong from comment #11) > I think this following: >=20 > https://godbolt.org/z/5sWEWWGox >=20 > ARM SVE GCC-11 correctly vectorize this codes. >=20 > But both GCC-12 and GCC-13 failed to vectorize it. >=20 > GCC-14 vectorize it in a wrong way. >=20 > Would it be possible to recover it back to GCC-11 ? With GCC 11 it probably SLP vectorizes the completely unrolled nest. That can be recovered with -fno-tree-loop-vectorize on trunk which on x86_64 produces main: .LFB0: .cfi_startproc movl a+4(%rip), %edx xorl %eax, %eax movl $2, b(%rip) testl %edx, %edx sete %al movd %eax, %xmm0 setne %al movzbl %al, %eax pshufd $0, %xmm0, %xmm0 movups %xmm0, a+4(%rip) movd %eax, %xmm1 movups %xmm0, a+20(%rip) pshufd $0, %xmm1, %xmm0 movups %xmm0, a+40(%rip) movups %xmm0, a+56(%rip) ret=