From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 745243938C25; Wed, 7 Apr 2021 15:41:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 745243938C25 From: "acoplan at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/99960] New: MVE: Wrong code storing V2DI vector Date: Wed, 07 Apr 2021 15:41:03 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: acoplan at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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, 07 Apr 2021 15:41:03 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99960 Bug ID: 99960 Summary: MVE: Wrong code storing V2DI vector Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: acoplan at gcc dot gnu.org Target Milestone: --- For the following testcase: typedef long long v2di __attribute((vector_size(16))); void foo(v2di *p) { *p =3D (v2di){ 1, 2 }; } we miscompile it at -O2 -march=3Darmv8.1-m.main+mve -mfloat-abi=3Dhard. Loo= king at the generated code: foo: @ args =3D 0, pretend =3D 0, frame =3D 0 @ frame_needed =3D 0, uses_anonymous_args =3D 0 @ link register save eliminated. vldr.64 d6, .L3 vldr.64 d7, .L3+8 vstr.64 d6, [r0] bx lr .L4: .align 3 .L3: .word 1 .word 0 .word 2 .word 0 .size foo, .-foo it looks like we're missing a store of d7. Here's a full testcase: typedef long long v2di __attribute((vector_size(16))); __attribute((noipa)) void stvec (v2di *p) { *p =3D (v2di){ 1, 2 }; } int main () { v2di v; stvec(&v); if (v[1] !=3D 2) __builtin_abort (); } I originally noticed this while investigating an execution failure for gcc.c-torture/execute/pr92618.c. FWIW, clang does: foo: adr r1, .LCPI0_0 vldrw.u32 q0, [r1] vstrw.32 q0, [r0] bx lr .LCPI0_0: .long 1 @ 0x1 .long 0 @ 0x0 .long 2 @ 0x2 .long 0 @ 0x0=