Commit fb638355 by Geoffrey Keating Committed by Geoffrey Keating

dwarf2out.c (DWARF2_FRAME_REG_OUT): Move up in file.

	* dwarf2out.c (DWARF2_FRAME_REG_OUT): Move up in file.
	(expand_builtin_dwarf_sp_column): Call DWARF2_FRAME_REG_OUT.
	(expand_builtin_init_dwarf_reg_sizes): Likewise.

From-SVN: r111825
parent 0f047685
2006-03-07 Geoffrey Keating <geoffk@apple.com>
* dwarf2out.c (DWARF2_FRAME_REG_OUT): Move up in file.
(expand_builtin_dwarf_sp_column): Call DWARF2_FRAME_REG_OUT.
(expand_builtin_init_dwarf_reg_sizes): Likewise.
2006-03-08 David Billinghurst <David.Billinghurst@riotinto.com> 2006-03-08 David Billinghurst <David.Billinghurst@riotinto.com>
PR target/26588 PR target/26588
......
...@@ -99,6 +99,13 @@ static void dwarf2out_source_line (unsigned int, const char *); ...@@ -99,6 +99,13 @@ static void dwarf2out_source_line (unsigned int, const char *);
# endif # endif
#endif #endif
/* Map register numbers held in the call frame info that gcc has
collected using DWARF_FRAME_REGNUM to those that should be output in
.debug_frame and .eh_frame. */
#ifndef DWARF2_FRAME_REG_OUT
#define DWARF2_FRAME_REG_OUT(REGNO, FOR_EH) (REGNO)
#endif
/* Decide whether we want to emit frame unwind information for the current /* Decide whether we want to emit frame unwind information for the current
translation unit. */ translation unit. */
...@@ -404,7 +411,8 @@ static void def_cfa_1 (const char *, dw_cfa_location *); ...@@ -404,7 +411,8 @@ static void def_cfa_1 (const char *, dw_cfa_location *);
rtx rtx
expand_builtin_dwarf_sp_column (void) expand_builtin_dwarf_sp_column (void)
{ {
return GEN_INT (DWARF_FRAME_REGNUM (STACK_POINTER_REGNUM)); int dwarf_regnum = DWARF_FRAME_REGNUM (STACK_POINTER_REGNUM);
return GEN_INT (DWARF2_FRAME_REG_OUT (dwarf_regnum, 1));
} }
/* Return a pointer to a copy of the section string name S with all /* Return a pointer to a copy of the section string name S with all
...@@ -437,27 +445,31 @@ expand_builtin_init_dwarf_reg_sizes (tree address) ...@@ -437,27 +445,31 @@ expand_builtin_init_dwarf_reg_sizes (tree address)
bool wrote_return_column = false; bool wrote_return_column = false;
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (DWARF_FRAME_REGNUM (i) < DWARF_FRAME_REGISTERS) {
{ int rnum = DWARF2_FRAME_REG_OUT (DWARF_FRAME_REGNUM (i), 1);
HOST_WIDE_INT offset = DWARF_FRAME_REGNUM (i) * GET_MODE_SIZE (mode);
enum machine_mode save_mode = reg_raw_mode[i]; if (rnum < DWARF_FRAME_REGISTERS)
HOST_WIDE_INT size; {
HOST_WIDE_INT offset = rnum * GET_MODE_SIZE (mode);
if (HARD_REGNO_CALL_PART_CLOBBERED (i, save_mode)) enum machine_mode save_mode = reg_raw_mode[i];
save_mode = choose_hard_reg_mode (i, 1, true); HOST_WIDE_INT size;
if (DWARF_FRAME_REGNUM (i) == DWARF_FRAME_RETURN_COLUMN)
{ if (HARD_REGNO_CALL_PART_CLOBBERED (i, save_mode))
if (save_mode == VOIDmode) save_mode = choose_hard_reg_mode (i, 1, true);
continue; if (DWARF_FRAME_REGNUM (i) == DWARF_FRAME_RETURN_COLUMN)
wrote_return_column = true; {
} if (save_mode == VOIDmode)
size = GET_MODE_SIZE (save_mode); continue;
if (offset < 0) wrote_return_column = true;
continue; }
size = GET_MODE_SIZE (save_mode);
emit_move_insn (adjust_address (mem, mode, offset), if (offset < 0)
gen_int_mode (size, mode)); continue;
}
emit_move_insn (adjust_address (mem, mode, offset),
gen_int_mode (size, mode));
}
}
#ifdef DWARF_ALT_FRAME_RETURN_COLUMN #ifdef DWARF_ALT_FRAME_RETURN_COLUMN
gcc_assert (wrote_return_column); gcc_assert (wrote_return_column);
...@@ -2011,13 +2023,6 @@ switch_to_eh_frame_section (void) ...@@ -2011,13 +2023,6 @@ switch_to_eh_frame_section (void)
} }
} }
/* Map register numbers held in the call frame info that gcc has
collected using DWARF_FRAME_REGNUM to those that should be output in
.debug_frame and .eh_frame. */
#ifndef DWARF2_FRAME_REG_OUT
#define DWARF2_FRAME_REG_OUT(REGNO, FOR_EH) (REGNO)
#endif
/* Output a Call Frame Information opcode and its operand(s). */ /* Output a Call Frame Information opcode and its operand(s). */
static void static void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment