mn10300: Fix debug offsets into the stack frame

We were using debugging hooks to semi-correct a mistake
in the lack of ARG_POINTER_CFA_OFFSET.

From-SVN: r168672
This commit is contained in:
Richard Henderson 2011-01-11 10:20:37 -08:00 committed by Richard Henderson
parent cc909bba64
commit c157b3f0d2
2 changed files with 7 additions and 26 deletions

View File

@ -1,5 +1,9 @@
2011-01-11 Richard Henderson <rth@redhat.com>
* config/mn10300/mn10300.h (ARG_PIONTER_CFA_OFFSET): New.
(DEBUGGER_AUTO_OFFSET): Remove.
(DEBUGGER_ARG_OFFSET): Remove.
* config/mn10300/mn10300.c (mn10300_gen_multiple_store): Make static.
Emit register stores with the same offsets as the hardware.
(mn10300_store_multiple_operation): Don't check that the register

View File

@ -463,6 +463,9 @@ enum reg_class
#define FIRST_PARM_OFFSET(FNDECL) 4
/* But the CFA is at the arg pointer directly, not at the first argument. */
#define ARG_POINTER_CFA_OFFSET(FNDECL) 0
#define ELIMINABLE_REGS \
{{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
{ ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \
@ -726,34 +729,8 @@ struct cum_arg
#undef PREFERRED_DEBUGGING_TYPE
#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
#define DWARF2_DEBUGGING_INFO 1
#define DWARF2_ASM_LINE_DEBUG_INFO 1
/* GDB always assumes the current function's frame begins at the value
of the stack pointer upon entry to the current function. Accessing
local variables and parameters passed on the stack is done using the
base of the frame + an offset provided by GCC.
For functions which have frame pointers this method works fine;
the (frame pointer) == (stack pointer at function entry) and GCC provides
an offset relative to the frame pointer.
This loses for functions without a frame pointer; GCC provides an offset
which is relative to the stack pointer after adjusting for the function's
frame size. GDB would prefer the offset to be relative to the value of
the stack pointer at the function's entry. Yuk! */
#define DEBUGGER_AUTO_OFFSET(X) \
((GET_CODE (X) == PLUS ? INTVAL (XEXP (X, 1)) : 0) \
+ (frame_pointer_needed \
? 0 : - mn10300_initial_offset (FRAME_POINTER_REGNUM, \
STACK_POINTER_REGNUM)))
#define DEBUGGER_ARG_OFFSET(OFFSET, X) \
((GET_CODE (X) == PLUS ? OFFSET : 0) \
+ (frame_pointer_needed \
? 0 : - mn10300_initial_offset (ARG_POINTER_REGNUM, \
STACK_POINTER_REGNUM)))
/* Specify the machine mode that this machine uses
for the index in the tablejump instruction. */
#define CASE_VECTOR_MODE Pmode