/* Maximum size (in bytes) of an artificially generated label. */
#define MAX_ARTIFICIAL_LABEL_BYTES 30
-
-/* Short-hand for commonly used register numbers. */
-#define DW_STACK_POINTER_REGNUM dwarf_frame_regnum (STACK_POINTER_REGNUM)
-#define DW_FRAME_POINTER_REGNUM dwarf_frame_regnum (HARD_FRAME_POINTER_REGNUM)
\f
/* A vector of call frame insns for the CIE. */
cfi_vec cie_cfi_vec;
/* True if any CFI directives were emitted at the current insn. */
static bool any_cfis_emitted;
+
+/* Short-hand for commonly used register numbers. */
+static unsigned dw_stack_pointer_regnum;
+static unsigned dw_frame_pointer_regnum;
\f
static void dwarf2out_cfi_begin_epilogue (rtx insn);
rtx
expand_builtin_dwarf_sp_column (void)
{
- unsigned int dwarf_regnum = DW_STACK_POINTER_REGNUM;
+ unsigned int dwarf_regnum = DWARF_FRAME_REGNUM (STACK_POINTER_REGNUM);
return GEN_INT (DWARF2_FRAME_REG_OUT (dwarf_regnum, 1));
}
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
{
- unsigned int rnum = DWARF2_FRAME_REG_OUT (dwarf_frame_regnum (i), 1);
+ unsigned int dnum = DWARF_FRAME_REGNUM (i);
+ unsigned int rnum = DWARF2_FRAME_REG_OUT (dnum, 1);
if (rnum < DWARF_FRAME_REGISTERS)
{
if (HARD_REGNO_CALL_PART_CLOBBERED (i, save_mode))
save_mode = choose_hard_reg_mode (i, 1, true);
- if (dwarf_frame_regnum (i) == DWARF_FRAME_RETURN_COLUMN)
+ if (dnum == DWARF_FRAME_RETURN_COLUMN)
{
if (save_mode == VOIDmode)
continue;
static void
dwarf2out_stack_adjust (HOST_WIDE_INT offset)
{
- if (cfa.reg == DW_STACK_POINTER_REGNUM)
+ if (cfa.reg == dw_stack_pointer_regnum)
cfa.offset += offset;
- if (cfa_store.reg == DW_STACK_POINTER_REGNUM)
+ if (cfa_store.reg == dw_stack_pointer_regnum)
cfa_store.offset += offset;
if (ACCUMULATE_OUTGOING_ARGS)
/* If only calls can throw, and we have a frame pointer,
save up adjustments until we see the CALL_INSN. */
- if (!flag_asynchronous_unwind_tables && cfa.reg != DW_STACK_POINTER_REGNUM)
+ if (!flag_asynchronous_unwind_tables && cfa.reg != dw_stack_pointer_regnum)
{
if (CALL_P (insn) && !after_p)
{
static GTY(()) reg_saved_in_data *cie_return_save;
/* Short-hand inline for the very common D_F_R (REGNO (x)) operation. */
-/* ??? This ought to go into dwarf2out.h alongside dwarf_frame_regnum,
- except that dwarf2out.h is used in places where rtl is prohibited. */
+/* ??? This ought to go into dwarf2out.h, except that dwarf2out.h is
+ used in places where rtl is prohibited. */
static inline unsigned
dwf_regno (const_rtx reg)
{
- return dwarf_frame_regnum (REGNO (reg));
+ return DWARF_FRAME_REGNUM (REGNO (reg));
}
/* Compare X and Y for equivalence. The inputs may be REGs or PC_RTX. */
if (XEXP (src, 0) == hard_frame_pointer_rtx)
{
/* Restoring SP from FP in the epilogue. */
- gcc_assert (cfa.reg == DW_FRAME_POINTER_REGNUM);
- cfa.reg = DW_STACK_POINTER_REGNUM;
+ gcc_assert (cfa.reg == dw_frame_pointer_regnum);
+ cfa.reg = dw_stack_pointer_regnum;
}
else if (GET_CODE (src) == LO_SUM)
/* Assume we've set the source reg of the LO_SUM from sp. */
if (GET_CODE (src) != MINUS)
offset = -offset;
- if (cfa.reg == DW_STACK_POINTER_REGNUM)
+ if (cfa.reg == dw_stack_pointer_regnum)
cfa.offset += offset;
- if (cfa_store.reg == DW_STACK_POINTER_REGNUM)
+ if (cfa_store.reg == dw_stack_pointer_regnum)
cfa_store.offset += offset;
}
else if (dest == hard_frame_pointer_rtx)
if (GET_CODE (src) != MINUS)
offset = -offset;
cfa.offset += offset;
- cfa.reg = DW_FRAME_POINTER_REGNUM;
+ cfa.reg = dw_frame_pointer_regnum;
}
else
{
{
/* Setting a scratch register that we will use instead
of SP for saving registers to the stack. */
- gcc_assert (cfa.reg == DW_STACK_POINTER_REGNUM);
+ gcc_assert (cfa.reg == dw_stack_pointer_regnum);
cfa_store.reg = dwf_regno (dest);
cfa_store.offset = cfa.offset - cfa_temp.offset;
}
fde->stack_realignment = INTVAL (XEXP (src, 1));
cfa_store.offset = 0;
- if (cfa.reg != DW_STACK_POINTER_REGNUM
- && cfa.reg != DW_FRAME_POINTER_REGNUM)
+ if (cfa.reg != dw_stack_pointer_regnum
+ && cfa.reg != dw_frame_pointer_regnum)
fde->drap_reg = cfa.reg;
}
return;
offset = -INTVAL (XEXP (XEXP (XEXP (dest, 0), 1), 1));
gcc_assert (REGNO (XEXP (XEXP (dest, 0), 0)) == STACK_POINTER_REGNUM
- && cfa_store.reg == DW_STACK_POINTER_REGNUM);
+ && cfa_store.reg == dw_stack_pointer_regnum);
cfa_store.offset += offset;
- if (cfa.reg == DW_STACK_POINTER_REGNUM)
+ if (cfa.reg == dw_stack_pointer_regnum)
cfa.offset = cfa_store.offset;
if (GET_CODE (XEXP (dest, 0)) == POST_MODIFY)
gcc_assert ((REGNO (XEXP (XEXP (dest, 0), 0))
== STACK_POINTER_REGNUM)
- && cfa_store.reg == DW_STACK_POINTER_REGNUM);
+ && cfa_store.reg == dw_stack_pointer_regnum);
cfa_store.offset += offset;
&& fde->stack_realign
&& src == hard_frame_pointer_rtx)
{
- gcc_assert (cfa.reg != DW_FRAME_POINTER_REGNUM);
+ gcc_assert (cfa.reg != dw_frame_pointer_regnum);
cfa_store.offset = 0;
}
- if (cfa.reg == DW_STACK_POINTER_REGNUM)
+ if (cfa.reg == dw_stack_pointer_regnum)
cfa.offset = cfa_store.offset;
if (GET_CODE (XEXP (dest, 0)) == POST_DEC)
if (fde
&& fde->stack_realign
&& cfa.indirect == 0
- && cfa.reg != DW_FRAME_POINTER_REGNUM)
+ && cfa.reg != dw_frame_pointer_regnum)
{
dw_cfa_location cfa_exp;
gcc_assert (fde->drap_reg == cfa.reg);
cfa_exp.indirect = 1;
- cfa_exp.reg = DW_FRAME_POINTER_REGNUM;
+ cfa_exp.reg = dw_frame_pointer_regnum;
cfa_exp.base_offset = offset;
cfa_exp.offset = 0;
{
dw_cfa_location loc;
+ dw_stack_pointer_regnum = DWARF_FRAME_REGNUM (STACK_POINTER_REGNUM);
+ dw_frame_pointer_regnum = DWARF_FRAME_REGNUM (HARD_FRAME_POINTER_REGNUM);
+
add_cfi_vec = &cie_cfi_vec;
- memset(&old_cfa, 0, sizeof (old_cfa));
+ memset (&old_cfa, 0, sizeof (old_cfa));
old_cfa.reg = INVALID_REGNUM;
/* On entry, the Canonical Frame Address is at SP. */
memset(&loc, 0, sizeof (loc));
- loc.reg = DW_STACK_POINTER_REGNUM;
+ loc.reg = dw_stack_pointer_regnum;
loc.offset = INCOMING_FRAME_SP_OFFSET;
def_cfa_1 (&loc);
gcc_checking_assert (regs_saved_in_regs == NULL);
memset (&cfa, 0, sizeof(cfa));
- cfa.reg = DW_STACK_POINTER_REGNUM;
+ cfa.reg = dw_stack_pointer_regnum;
cfa.offset = INCOMING_FRAME_SP_OFFSET;
old_cfa = cfa;