public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/97638] New: aarch64: bti c is missing at function entry with branch-protection
@ 2020-10-30 11:16 nsz at gcc dot gnu.org
  2020-11-02 15:53 ` [Bug target/97638] " cvs-commit at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: nsz at gcc dot gnu.org @ 2020-10-30 11:16 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 97638
           Summary: aarch64: bti c is missing at function entry with
                    branch-protection
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nsz at gcc dot gnu.org
  Target Milestone: ---

gcc-10 (and trunk) with -mbranch-protection=bti (or standard)
fails to generate bti c at function entry in some cases:

char *foo (const char *s, const int c)
{
  const char *p = 0;
  for (;;)
  {
        if (*s == c)
            p = s;
        if (p != 0 || *s++ == 0)
            break;
  }
  return (char *)p;
}

gcc -O2 -mbranch-protection=bti is

foo:
.L3:
        ldrb    w2, [x0]
        cmp     w2, w1
        beq     .L2
        add     x0, x0, 1
        cbnz    w2, .L3
        mov     x0, 0
.L2:
        ret

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug target/97638] aarch64: bti c is missing at function entry with branch-protection
  2020-10-30 11:16 [Bug target/97638] New: aarch64: bti c is missing at function entry with branch-protection nsz at gcc dot gnu.org
@ 2020-11-02 15:53 ` cvs-commit at gcc dot gnu.org
  2020-11-09 14:51 ` cvs-commit at gcc dot gnu.org
  2021-02-08 13:17 ` wilco at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-11-02 15:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Sudakshina Das <sudi@gcc.gnu.org>:

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

commit r11-4615-gce99142c11b8090105cbf2aa853262f6d9abc0d3
Author: Sudakshina Das <sudi.das@arm.com>
Date:   Mon Nov 2 15:52:22 2020 +0000

    [PATCH] aarch64: Fix PR97638

    Currently the testcase in the patch was failing to produce
    a 'bti c' at the beginning of the function. This was because
    in aarch64_pac_insn_p, we were wrongly returning at the first
    check!

    2020-10-30  Sudakshina Das  <sudi.das@arm.com>

    gcc/ChangeLog:

            PR target/97638
            * config/aarch64/aarch64-bti-insert.c (aarch64_pac_insn_p): Update
            return value on INSN_P check.

    gcc/testsuite/ChangeLog:

            PR target/97638
            * gcc.target/aarch64/pr97638.c: New test.a

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug target/97638] aarch64: bti c is missing at function entry with branch-protection
  2020-10-30 11:16 [Bug target/97638] New: aarch64: bti c is missing at function entry with branch-protection nsz at gcc dot gnu.org
  2020-11-02 15:53 ` [Bug target/97638] " cvs-commit at gcc dot gnu.org
@ 2020-11-09 14:51 ` cvs-commit at gcc dot gnu.org
  2021-02-08 13:17 ` wilco at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-11-09 14:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Sudakshina Das
<sudi@gcc.gnu.org>:

https://gcc.gnu.org/g:454702f5213a7a8b6b3581c29c817b952ce0f184

commit r10-8996-g454702f5213a7a8b6b3581c29c817b952ce0f184
Author: Sudakshina Das <sudi.das@arm.com>
Date:   Mon Nov 2 15:52:22 2020 +0000

    [PATCH] aarch64: Fix PR97638

    Currently the testcase in the patch was failing to produce
    a 'bti c' at the beginning of the function. This was because
    in aarch64_pac_insn_p, we were wrongly returning at the first
    check!

    2020-10-30  Sudakshina Das  <sudi.das@arm.com>

    gcc/ChangeLog:

            PR target/97638
            * config/aarch64/aarch64-bti-insert.c (aarch64_pac_insn_p): Update
            return value on INSN_P check.

    gcc/testsuite/ChangeLog:

            PR target/97638
            * gcc.target/aarch64/pr97638.c: New test.a

    (cherry picked from commit ce99142c11b8090105cbf2aa853262f6d9abc0d3)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug target/97638] aarch64: bti c is missing at function entry with branch-protection
  2020-10-30 11:16 [Bug target/97638] New: aarch64: bti c is missing at function entry with branch-protection nsz at gcc dot gnu.org
  2020-11-02 15:53 ` [Bug target/97638] " cvs-commit at gcc dot gnu.org
  2020-11-09 14:51 ` cvs-commit at gcc dot gnu.org
@ 2021-02-08 13:17 ` wilco at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: wilco at gcc dot gnu.org @ 2021-02-08 13:17 UTC (permalink / raw)
  To: gcc-bugs

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

Wilco <wilco at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
                 CC|                            |wilco at gcc dot gnu.org
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #3 from Wilco <wilco at gcc dot gnu.org> ---
Fixed and backported, so close.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-02-08 13:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-30 11:16 [Bug target/97638] New: aarch64: bti c is missing at function entry with branch-protection nsz at gcc dot gnu.org
2020-11-02 15:53 ` [Bug target/97638] " cvs-commit at gcc dot gnu.org
2020-11-09 14:51 ` cvs-commit at gcc dot gnu.org
2021-02-08 13:17 ` wilco at gcc dot gnu.org

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).