public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/94697] aarch64: bti j at function start instead of bti c
Date: Thu, 14 May 2020 15:17:57 +0000	[thread overview]
Message-ID: <bug-94697-4-eIdBB1Qbnl@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-94697-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94697

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Szabolcs Nagy <nsz@gcc.gnu.org>:

https://gcc.gnu.org/g:f6e42cdee5de2b3441afc88c8888c1166bdffe57

commit r9-8594-gf6e42cdee5de2b3441afc88c8888c1166bdffe57
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Fri Apr 17 16:54:12 2020 +0100

    aarch64: ensure bti c is emitted at function start [PR94697]

    The bti pass currently first emits bti c at function start
    if there is no paciasp (which also acts as indirect call
    landing pad), then bti j is emitted at jump labels, however
    if there is a label right before paciasp then the function
    start can end up like

      foo:
      label:
        bti j
        paciasp
        ...

    This patch is a minimal fix that just moves the bti c handling
    after the bti j handling so we end up with

      foo:
        bti c
      label:
        bti j
        paciasp
        ...

    This could be improved by emitting bti jc in this case, or by
    detecting that the label is not in fact an indirect jump target
    and then this situation would be much less common.

    Needs to be backported to gcc-9 branch.

    Backported without the testcase because of missing infrastructure
    for check-function-bodies.

    gcc/ChangeLog:

            Backport from mainline.
            2020-04-23  Szabolcs Nagy  <szabolcs.nagy@arm.com>

            PR target/94697
            * config/aarch64/aarch64-bti-insert.c (rest_of_insert_bti): Swap
            bti c and bti j handling.

  parent reply	other threads:[~2020-05-14 15:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-21 15:13 [Bug target/94697] New: " nsz at gcc dot gnu.org
2020-04-22 10:01 ` [Bug target/94697] " rearnsha at gcc dot gnu.org
2020-04-23 15:15 ` cvs-commit at gcc dot gnu.org
2020-04-23 18:22 ` nsz at gcc dot gnu.org
2020-04-27 11:13 ` clyon at gcc dot gnu.org
2020-04-27 17:18 ` cvs-commit at gcc dot gnu.org
2020-05-07 11:56 ` jakub at gcc dot gnu.org
2020-05-07 12:01 ` nsz at gcc dot gnu.org
2020-05-14 15:17 ` cvs-commit at gcc dot gnu.org [this message]
2020-05-14 15:53 ` nsz at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-94697-4-eIdBB1Qbnl@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).