rtx aarch64_eh_return_handler_rtx (void);
rtx aarch64_mask_from_zextract_ops (rtx, rtx);
const char *aarch64_output_move_struct (rtx *operands);
+rtx aarch64_return_addr_rtx (void);
rtx aarch64_return_addr (int, rtx);
rtx aarch64_simd_gen_const_vector_dup (machine_mode, HOST_WIDE_INT);
bool aarch64_simd_mem_operand_p (rtx);
return cfun->machine->frame.frame_size;
}
+
+/* Get return address without mangling. */
+
+rtx
+aarch64_return_addr_rtx (void)
+{
+ rtx val = get_hard_reg_initial_val (Pmode, LR_REGNUM);
+ /* Note: aarch64_return_address_signing_enabled only
+ works after cfun->machine->frame.laid_out is set,
+ so here we don't know if the return address will
+ be signed or not. */
+ rtx lr = gen_rtx_REG (Pmode, LR_REGNUM);
+ emit_move_insn (lr, val);
+ emit_insn (GEN_FCN (CODE_FOR_xpaclri) ());
+ return lr;
+}
+
+
/* Implement RETURN_ADDR_RTX. We do not support moving back to a
previous frame. */
{
if (count != 0)
return const0_rtx;
- return get_hard_reg_initial_val (Pmode, LR_REGNUM);
+ return aarch64_return_addr_rtx ();
}
static void
#define PROFILE_HOOK(LABEL) \
{ \
rtx fun, lr; \
- lr = get_hard_reg_initial_val (Pmode, LR_REGNUM); \
+ lr = aarch64_return_addr_rtx (); \
fun = gen_rtx_SYMBOL_REF (Pmode, MCOUNT_NAME); \
emit_library_call (fun, LCT_NORMAL, VOIDmode, lr, Pmode); \
}