+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.
+
2020-04-23 Andrew Stubbs <ams@codesourcery.com>
Thomas Schwinge <thomas@codesourcery.com>
rtx_insn *insn;
basic_block bb;
- /* Since a Branch Target Exception can only be triggered by an indirect call,
- we exempt function that are only called directly. We also exempt
- functions that are already protected by Return Address Signing (PACIASP/
- PACIBSP). For all other cases insert a BTI C at the beginning of the
- function. */
- if (!cgraph_node::get (cfun->decl)->only_called_directly_p ())
- {
- bb = ENTRY_BLOCK_PTR_FOR_FN (cfun)->next_bb;
- insn = BB_HEAD (bb);
- if (!aarch64_pac_insn_p (get_first_nonnote_insn ()))
- {
- bti_insn = gen_bti_c ();
- emit_insn_before (bti_insn, insn);
- }
- }
-
bb = 0;
FOR_EACH_BB_FN (bb, cfun)
{
}
}
+ /* Since a Branch Target Exception can only be triggered by an indirect call,
+ we exempt function that are only called directly. We also exempt
+ functions that are already protected by Return Address Signing (PACIASP/
+ PACIBSP). For all other cases insert a BTI C at the beginning of the
+ function. */
+ if (!cgraph_node::get (cfun->decl)->only_called_directly_p ())
+ {
+ bb = ENTRY_BLOCK_PTR_FOR_FN (cfun)->next_bb;
+ insn = BB_HEAD (bb);
+ if (!aarch64_pac_insn_p (get_first_nonnote_insn ()))
+ {
+ bti_insn = gen_bti_c ();
+ emit_insn_before (bti_insn, insn);
+ }
+ }
+
timevar_pop (TV_MACH_DEP);
return 0;
}