OSDN Git Service

mn10300: Fix debug offsets into the stack frame
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 11 Jan 2011 18:20:37 +0000 (18:20 +0000)
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 11 Jan 2011 18:20:37 +0000 (18:20 +0000)
We were using debugging hooks to semi-correct a mistake
in the lack of ARG_POINTER_CFA_OFFSET.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@168672 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/mn10300/mn10300.h

index 46f5023..d00880b 100644 (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
index febceb5..bdd6b6f 100644 (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