From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 78BE93858D35; Fri, 5 Nov 2021 09:50:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 78BE93858D35 From: "tnfchris at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/103094] New: [12 Regression] Incorrect codegen from AArch64 intrinsics Date: Fri, 05 Nov 2021 09:50:07 +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: 12.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: tnfchris 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 keywords bug_severity priority component assigned_to reporter target_milestone cf_gcctarget 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: Fri, 05 Nov 2021 09:50:07 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103094 Bug ID: 103094 Summary: [12 Regression] Incorrect codegen from AArch64 intrinsics Product: gcc Version: 12.0 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: tnfchris at gcc dot gnu.org Target Milestone: --- Target: aarch64-* The following testcase --- #include void foo (uint8x8x2_t cols_01_23, uint8x8x2_t cols_45_67, uint16_t* outptr0) { uint16x4x4_t cols_01_23_45_67 =3D { { vreinterpret_u16_u8(cols_01_23.val[0]), vreinterpret_u16_u8(cols_01_23.val[1]), vreinterpret_u16_u8(cols_45_67.val[0]), vreinterpret_u16_u8(cols_45_67.val[1]) } }; vst4_lane_u16(outptr0, cols_01_23_45_67, 0); } --- Causes incorrect codegen ``` foo: mov v4.8b, v0.8b mov v5.8b, v1.8b mov v6.8b, v1.8b mov v7.8b, v2.8b st4 {v4.h - v7.h}[0], [x0] ret ``` as the same register `v1` is used as source for two inputs. This happens in cprop_hardreg where a correct RTL ``` (insn 20 37 26 2 (set (reg:V4HI 61 v29 [ __val+8 ]) (reg:V4HI 36 v4 [ cols_01_23+8 ])) 1158 {*aarch64_simd_movv4hi} (nil)) ``` is turned into ``` (insn 20 37 26 2 (set (reg:V4HI 61 v29 [ __val+8 ]) (reg:V4HI 33 v1 [orig:36 cols_01_23+8 ] [36])) 1158 {*aarch64_simd_movv4hi} (nil)) ``` which is a bogus transform as `v1` is still live and pointing to `cols_45_6= 7`. started somewhere between g:4096eb50d108a9ccef134f2e891c751b1cc9f6b2 and g:29a1af24eface3620e348be9429e7c2e872accbc=