+2017-01-19 Jiong Wang <jiong.wang@arm.com>
+
+ * reg-notes.def (CFA_TOGGLE_RA_MANGLE): New reg-note.
+ * combine-stack-adj.c (no_unhandled_cfa): Handle
+ REG_CFA_TOGGLE_RA_MANGLE.
+ * dwarf2cfi.c (dwarf2out_frame_debug): Handle REG_CFA_TOGGLE_RA_MANGLE.
+ * config/aarch64/aarch64.c (aarch64_expand_prologue): Generates DWARF
+ info for return address signing.
+ (aarch64_expand_epilogue): Likewise.
+
2017-01-19 Jiong Wang <jiong.wang@arm.com>
* config/aarch64/aarch64-opts.h (aarch64_function_type): New enum.
case REG_CFA_SET_VDRAP:
case REG_CFA_WINDOW_SAVE:
case REG_CFA_FLUSH_QUEUE:
+ case REG_CFA_TOGGLE_RA_MANGLE:
return false;
}
/* Sign return address for functions. */
if (aarch64_return_address_signing_enabled ())
- emit_insn (gen_pacisp ());
+ {
+ insn = emit_insn (gen_pacisp ());
+ add_reg_note (insn, REG_CFA_TOGGLE_RA_MANGLE, const0_rtx);
+ RTX_FRAME_RELATED_P (insn) = 1;
+ }
if (flag_stack_usage_info)
current_function_static_stack_size = frame_size;
*/
if (aarch64_return_address_signing_enabled ()
&& (for_sibcall || !TARGET_ARMV8_3 || crtl->calls_eh_return))
- emit_insn (gen_autisp ());
+ {
+ insn = emit_insn (gen_autisp ());
+ add_reg_note (insn, REG_CFA_TOGGLE_RA_MANGLE, const0_rtx);
+ RTX_FRAME_RELATED_P (insn) = 1;
+ }
/* Stack adjustment for exception handler. */
if (crtl->calls_eh_return)
handled_one = true;
break;
+ case REG_CFA_TOGGLE_RA_MANGLE:
case REG_CFA_WINDOW_SAVE:
+ /* We overload both of these operations onto the same DWARF opcode. */
dwarf2out_frame_debug_cfa_window_save ();
handled_one = true;
break;
the rest of the compiler as a CALL_INSN. */
REG_NOTE (CFA_FLUSH_QUEUE)
+/* Attached to insns that are RTX_FRAME_RELATED_P, toggling the mangling status
+ of return address. Currently it's only used by AArch64. The argument is
+ ignored. */
+REG_NOTE (CFA_TOGGLE_RA_MANGLE)
+
/* Indicates what exception region an INSN belongs in. This is used
to indicate what region to which a call may throw. REGION 0
indicates that a call cannot throw at all. REGION -1 indicates