From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A7FCB3858C52; Tue, 26 Jul 2022 06:28:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A7FCB3858C52 From: "luoxhu at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/106069] [12/13 Regression] wrong code with -O -fno-tree-forwprop -maltivec on ppc64le Date: Tue, 26 Jul 2022 06:28:47 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: luoxhu at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.2 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: Tue, 26 Jul 2022 06:28:47 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106069 --- Comment #16 from luoxhu at gcc dot gnu.org --- The attached files are all built with -mcpu=3Dpower8 and the case also fail= s on P8LE. Also I verified the code produces expected output on P8BE. ('Aborted' is ca= used by BE returns 0x41 instead of 0x98 for LE.) P8LE &P9LE: luoxhu@gcc135 build $ ./q.bad B0: 0, 0,0,0 Aborted P8BE: luoxhu@gcc203:~/workspace/build$ ./q.bad B0: 41fcef98, 91648e8b,7dca18c6,61707865 Aborted P8BE seems generates better code with the patch: luoxhu@gcc203:~/workspace/build$ diff q.good.S q.bad.S -U5 --- q.good.S 2022-07-26 09:19:32.487216946 +0300 +++ q.bad.S 2022-07-26 09:15:58.006770996 +0300 @@ -1,6 +1,7 @@ .file "q.C" + .machine power8 .section ".text" .section .rodata.str1.8,"aMS",@progbits,1 .align 3 .LC0: .string "B0: %x, %x,%x,%x\n" @@ -24,19 +25,17 @@ .cfi_def_cfa_offset 128 .cfi_offset 65, 16 .cfi_offset 30, -16 .cfi_offset 31, -8 mr %r30,%r3 - vmrghw %v2,%v2,%v4 - vmrghw %v5,%v3,%v5 - vmrghw %v5,%v2,%v5 - vspltw %v0,%v5,3 + vspltw %v0,%v5,0 mfvsrwz %r7,%vs32 - vspltw %v0,%v5,2 + vspltw %v0,%v4,0 mfvsrwz %r6,%vs32 - mfvsrwz %r5,%vs37 - vspltw %v0,%v5,0 + vspltw %v0,%v3,0 + mfvsrwz %r5,%vs32 + vspltw %v0,%v2,0 mfvsrwz %r31,%vs32 rldicl %r7,%r7,0,32 rldicl %r6,%r6,0,32 rldicl %r5,%r5,0,32 rldicl %r4,%r31,0,32 @@ -169,6 +168,6 @@ .set .LANCHOR1,. + 0 .type res, @object .size res, 1 res: .zero 1 - .ident "GCC: (Debian 9.5.0-1) 9.5.0" + .ident "GCC: (GNU) 13.0.0 20220726 (experimental)"=