From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 37502385DC2E; Fri, 9 Apr 2021 10:13:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 37502385DC2E From: "acoplan at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/99988] New: aarch64: GCC generates excessive consecutive bti j instructions Date: Fri, 09 Apr 2021 10:13:05 +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 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: Fri, 09 Apr 2021 10:13:06 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99988 Bug ID: 99988 Summary: aarch64: GCC generates excessive consecutive bti j instructions 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: --- Created attachment 50535 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D50535&action=3Dedit minimal reproducer For the attached testcase (reduced from the linux kernel), GCC generates multiple redundant sequences of back-to-back bti j instructions, the longes= t of which is 262 instructions long. To reproduce: $ aarch64-linux-gnu-gcc -c test.c -S -o - -O2 -mbranch-protection=3Dstandar= d | uniq -c | grep "bti j" | sort -nr 262 hint 36 // bti j 7 hint 36 // bti j 6 hint 36 // bti j 4 hint 36 // bti j 4 hint 36 // bti j 3 hint 36 // bti j 2 hint 36 // bti j 2 hint 36 // bti j 2 hint 36 // bti j 2 hint 36 // bti j 2 hint 36 // bti j 2 hint 36 // bti j 2 hint 36 // bti j=