return false;
}
+/* Entry point for saving the first register into the second. */
+
+void
+dwarf2out_reg_save_reg (const char *label, rtx reg, rtx sreg)
+{
+ size_t i;
+ unsigned int regno, sregno;
+
+ for (i = 0; i < num_regs_saved_in_regs; i++)
+ if (REGNO (regs_saved_in_regs[i].orig_reg) == REGNO (reg))
+ break;
+ if (i == num_regs_saved_in_regs)
+ {
+ gcc_assert (i != ARRAY_SIZE (regs_saved_in_regs));
+ num_regs_saved_in_regs++;
+ }
+ regs_saved_in_regs[i].orig_reg = reg;
+ regs_saved_in_regs[i].saved_in_reg = sreg;
+
+ regno = DWARF_FRAME_REGNUM (REGNO (reg));
+ sregno = DWARF_FRAME_REGNUM (REGNO (sreg));
+ reg_save (label, regno, sregno, 0);
+}
+
/* What register, if any, is currently saved in REG? */
static rtx
case UNSPEC_VOLATILE:
gcc_assert (targetm.dwarf_handle_frame_unspec);
targetm.dwarf_handle_frame_unspec (label, expr, XINT (src, 1));
- break;
+ return;
default:
gcc_unreachable ();
dw2_asm_output_encoded_addr_rtx (
ASM_PREFERRED_EH_DATA_FORMAT (/*code=*/1, /*global=*/0),
gen_rtx_SYMBOL_REF (Pmode, cfi->dw_cfi_oprnd1.dw_cfi_addr),
- NULL);
+ false, NULL);
else
dw2_asm_output_addr (DWARF2_ADDR_SIZE,
cfi->dw_cfi_oprnd1.dw_cfi_addr, NULL);
dw2_asm_output_data (1, per_encoding, "Personality (%s)",
eh_data_format_name (per_encoding));
dw2_asm_output_encoded_addr_rtx (per_encoding,
- eh_personality_libfunc, NULL);
+ eh_personality_libfunc,
+ true, NULL);
}
if (any_lsda_needed)
SYMBOL_REF_FLAGS (sym_ref) |= SYMBOL_FLAG_LOCAL;
dw2_asm_output_encoded_addr_rtx (fde_encoding,
sym_ref,
+ false,
"FDE initial location");
if (fde->dw_fde_switched_sections)
{
fde->dw_fde_hot_section_label);
SYMBOL_REF_FLAGS (sym_ref2) |= SYMBOL_FLAG_LOCAL;
SYMBOL_REF_FLAGS (sym_ref3) |= SYMBOL_FLAG_LOCAL;
- dw2_asm_output_encoded_addr_rtx (fde_encoding, sym_ref3,
+ dw2_asm_output_encoded_addr_rtx (fde_encoding, sym_ref3, false,
"FDE initial location");
dw2_asm_output_delta (size_of_encoded_value (fde_encoding),
fde->dw_fde_hot_section_end_label,
fde->dw_fde_hot_section_label,
"FDE address range");
- dw2_asm_output_encoded_addr_rtx (fde_encoding, sym_ref2,
+ dw2_asm_output_encoded_addr_rtx (fde_encoding, sym_ref2, false,
"FDE initial location");
dw2_asm_output_delta (size_of_encoded_value (fde_encoding),
fde->dw_fde_unlikely_section_end_label,
fde->funcdef_number);
dw2_asm_output_encoded_addr_rtx (
lsda_encoding, gen_rtx_SYMBOL_REF (Pmode, l1),
- "Language Specific Data Area");
+ false, "Language Specific Data Area");
}
else
{
unsigned reg;
dw_loc_descr_ref loc_result = NULL;
- reg = dbx_reg_number (rtl);
+ reg = REGNO (rtl);
+#ifdef LEAF_REG_REMAP
+ reg = LEAF_REG_REMAP (reg);
+#endif
+ gcc_assert ((unsigned) DBX_REGISTER_NUMBER (reg) == dbx_reg_number (rtl));
nregs = hard_regno_nregs[REGNO (rtl)][GET_MODE (rtl)];
/* Simple, contiguous registers. */
{
dw_loc_descr_ref t;
- t = one_reg_loc_descriptor (reg);
+ t = one_reg_loc_descriptor (DBX_REGISTER_NUMBER (reg));
add_loc_descr (&loc_result, t);
add_loc_descr_op_piece (&loc_result, size);
++reg;
add_const_value_attribute (var_die, rtl);
}
+#ifdef DWARF2_UNWIND_INFO
/* Convert the CFI instructions for the current function into a location
list. This is used for DW_AT_frame_base when we targeting a dwarf2
consumer that does not support the dwarf3 DW_OP_call_frame_cfa. */
frame_pointer_cfa_offset = -offset;
}
+#endif
/* Generate a DW_AT_name attribute given some string value to be included as
the value of the attribute. */
if ((TREE_CODE (decl) == FUNCTION_DECL || TREE_CODE (decl) == VAR_DECL)
&& TREE_PUBLIC (decl)
&& DECL_ASSEMBLER_NAME (decl) != DECL_NAME (decl)
- && !DECL_ABSTRACT (decl))
+ && !DECL_ABSTRACT (decl)
+ && !(TREE_CODE (decl) == VAR_DECL && DECL_REGISTER (decl)))
add_AT_string (die, DW_AT_MIPS_linkage_name,
IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
}
add_AT_fde_ref (subr_die, DW_AT_MIPS_fde, current_funcdef_fde);
#endif
+#ifdef DWARF2_UNWIND_INFO
/* We define the "frame base" as the function's CFA. This is more
convenient for several reasons: (1) It's stable across the prologue
and epilogue, which makes it better than just a frame pointer,
debugger about. We'll need to adjust all frame_base references
by this displacement. */
compute_frame_pointer_to_cfa_displacement ();
+#else
+ /* For targets which support DWARF2, but not DWARF2 call-frame info,
+ we just use the stack pointer or frame pointer. */
+ /* ??? Should investigate getting better info via callbacks, or else
+ by interpreting the IA-64 unwind info. */
+ {
+ rtx fp_reg
+ = frame_pointer_needed ? hard_frame_pointer_rtx : stack_pointer_rtx;
+ add_AT_loc (subr_die, DW_AT_frame_base, reg_loc_descriptor (fp_reg));
+ }
+#endif
if (cfun->static_chain_decl)
add_AT_location_description (subr_die, DW_AT_static_link,