From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8F8BE385800A; Sat, 1 May 2021 19:30:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8F8BE385800A From: "luc.vanoostenryck at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/100378] New: [Regression 9/10/11/12] arm64: lsl + asr used instead of sxth Date: Sat, 01 May 2021 19:30:34 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: luc.vanoostenryck at gmail dot com 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 attachments.created 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: Sat, 01 May 2021 19:30:34 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100378 Bug ID: 100378 Summary: [Regression 9/10/11/12] arm64: lsl + asr used instead of sxth Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: luc.vanoostenryck at gmail dot com Target Milestone: --- Created attachment 50727 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D50727&action=3Dedit testcase On arm64, when compiling with optimization, for example with -O2, the following code: struct sh { short a; short b; short y[2]; }; int fooh(struct sh s) { return s.a; } produces the following assembly code since GCC9.x: fooh: lsl x0, x0, 16 asr w0, w0, 16 ret but with GCC8.x and before it produces the shorter: fooh(sh): sxth w0, w0 ret See https://gcc.godbolt.org/z/YrW7E3cro=