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

            Bug ID: 94748
           Summary: aarch64: many unnecessary bti j emitted
           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: ---

__attribute__((target("branch-protection=bti")))
int foo(void)
{
label:
  return 0;
} 


compiles to

foo:
        hint    34 // bti c
        hint    36 // bti j
        mov     w0, 0
        ret

the bti j is not necessary and bti j should be rarely emitted
otherwise the security architecture is weakened.

Reply via email to