From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 239CA388F031; Sun, 11 Apr 2021 01:44:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 239CA388F031 From: "luc.vanoostenryck at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/100028] New: arm64 failure to generate bfxil Date: Sun, 11 Apr 2021 01:44:22 +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: 10.2.0 X-Bugzilla-Keywords: missed-optimization 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 keywords bug_severity priority component assigned_to reporter target_milestone cf_gcctarget 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: Sun, 11 Apr 2021 01:44:27 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100028 Bug ID: 100028 Summary: arm64 failure to generate bfxil Product: gcc Version: 10.2.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: luc.vanoostenryck at gmail dot com Target Milestone: --- Target: aarch64 Created attachment 50555 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D50555&action=3Dedit should generate bfxil but doesn't The attached code reproduced here: #define W 3 #define L 11 int bfxil(int d, int s) { int wmask =3D (1 << W) - 1; return (d & ~wmask) | ((s >> L) & wmask); } Should return: bfxil: bfxil w0, w1, 11, 3 ret but instead returns: bfxil: ubfx x1, x1, 11, 3 and w0, w0, -8 orr w0, w1, w0 ret The problem is still present in trunk, was also present in 9.3 but wasn't in GCC 8.2 (see https://gcc.godbolt.org/z/E6z31hr9r ).=