summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordaney <daney@138bc75d-0d04-0410-961f-82ee72b054a4>2007-07-11 16:56:54 +0000
committerdaney <daney@138bc75d-0d04-0410-961f-82ee72b054a4>2007-07-11 16:56:54 +0000
commitf7e97fb8fd301c5dd0e90066f839d8ab322b9d49 (patch)
treecd8c11d3ca90b2a1dde60cda30555c3a684d36cb
parent23bd5abb10e7a81a2b3e0022de863f4d9b47e0e2 (diff)
downloadppe42-gcc-f7e97fb8fd301c5dd0e90066f839d8ab322b9d49.tar.gz
ppe42-gcc-f7e97fb8fd301c5dd0e90066f839d8ab322b9d49.zip
* config/mips/linux-unwind.h (mips_fallback_frame_state): Rewrite
return address calculation. Substitute DWARF_ALT_FRAME_RETURN_COLUMN for SIGNAL_UNWIND_RETURN_COLUMN. * config/mips/mips.h (SIGNAL_UNWIND_RETURN_COLUMN): Remove. (DWARF_FRAME_REGNUM): Rewrite. (DWARF_ALT_FRAME_RETURN_COLUMN) Define. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126555 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/config/mips/linux-unwind.h12
-rw-r--r--gcc/config/mips/mips.h16
3 files changed, 24 insertions, 13 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 81a530b5e7d..9b6a348be30 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+2007-07-11 David Daney <ddaney@avtrex.com>
+
+ * config/mips/linux-unwind.h (mips_fallback_frame_state): Rewrite
+ return address calculation. Substitute DWARF_ALT_FRAME_RETURN_COLUMN
+ for SIGNAL_UNWIND_RETURN_COLUMN.
+ * config/mips/mips.h (SIGNAL_UNWIND_RETURN_COLUMN): Remove.
+ (DWARF_FRAME_REGNUM): Rewrite.
+ (DWARF_ALT_FRAME_RETURN_COLUMN) Define.
+
2007-07-11 Nick Clifton <nickc@redhat.com>
* config/m32r/m32r.h (INITIALIZE_TRAMPOLINE): Revert previous
diff --git a/gcc/config/mips/linux-unwind.h b/gcc/config/mips/linux-unwind.h
index e10fc769830..dee77035fec 100644
--- a/gcc/config/mips/linux-unwind.h
+++ b/gcc/config/mips/linux-unwind.h
@@ -1,5 +1,5 @@
/* DWARF2 EH unwinding support for MIPS Linux.
- Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
This file is part of GCC.
@@ -51,7 +51,6 @@ mips_fallback_frame_state (struct _Unwind_Context *context,
_Unwind_FrameState *fs)
{
u_int32_t *pc = (u_int32_t *) context->ra;
- u_int32_t t;
struct sigcontext *sc;
_Unwind_Ptr new_cfa;
int i;
@@ -106,11 +105,10 @@ mips_fallback_frame_state (struct _Unwind_Context *context,
/* The PC points to the faulting instruction, but the unwind tables
expect it point to the following instruction. We compensate by
reporting a return address at the next instruction. */
- fs->regs.reg[SIGNAL_UNWIND_RETURN_COLUMN].how = REG_SAVED_VAL_OFFSET;
- t = (*(u_int32_t *)(void *)&sc->sc_pc) + 4;
- fs->regs.reg[SIGNAL_UNWIND_RETURN_COLUMN].loc.offset
- = (_Unwind_Ptr)t - new_cfa;
- fs->retaddr_column = SIGNAL_UNWIND_RETURN_COLUMN;
+ fs->regs.reg[DWARF_ALT_FRAME_RETURN_COLUMN].how = REG_SAVED_VAL_OFFSET;
+ fs->regs.reg[DWARF_ALT_FRAME_RETURN_COLUMN].loc.offset
+ = (_Unwind_Ptr)(sc->sc_pc) + 4 - new_cfa;
+ fs->retaddr_column = DWARF_ALT_FRAME_RETURN_COLUMN;
return _URC_NO_REASON;
}
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index 5c58806b63b..6ad6cf74be6 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -1,6 +1,7 @@
/* Definitions of target machine for GNU compiler. MIPS version.
Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998
- 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007
+ Free Software Foundation, Inc.
Contributed by A. Lichnewsky (lich@inria.inria.fr).
Changed by Michael Meissner (meissner@osf.org).
64-bit r4000 support by Ian Lance Taylor (ian@cygnus.com) and
@@ -1007,15 +1008,12 @@ extern const struct mips_rtx_cost_data *mips_cost;
#define DBX_REGISTER_NUMBER(REGNO) mips_dbx_regno[ (REGNO) ]
/* The mapping from gcc register number to DWARF 2 CFA column number. */
-#define DWARF_FRAME_REGNUM(REG) (REG)
+#define DWARF_FRAME_REGNUM(REG) \
+ ((REG) == DWARF_ALT_FRAME_RETURN_COLUMN ? INVALID_REGNUM : (REG))
/* The DWARF 2 CFA column which tracks the return address. */
#define DWARF_FRAME_RETURN_COLUMN (GP_REG_FIRST + 31)
-/* The DWARF 2 CFA column which tracks the return address from a
- signal handler context. */
-#define SIGNAL_UNWIND_RETURN_COLUMN (FP_REG_LAST + 1)
-
/* Before the prologue, RA lives in r31. */
#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (VOIDmode, GP_REG_FIRST + 31)
@@ -1359,6 +1357,12 @@ extern const struct mips_rtx_cost_data *mips_cost;
#define MD_REG_NUM (MD_REG_LAST - MD_REG_FIRST + 1)
#define MD_DBX_FIRST (FP_DBX_FIRST + FP_REG_NUM)
+/* The DWARF 2 CFA column which tracks the return address from a
+ signal handler context. This means that to maintain backwards
+ compatibility, no hard register can be assigned this column if it
+ would need to be handled by the DWARF unwinder. */
+#define DWARF_ALT_FRAME_RETURN_COLUMN 66
+
#define ST_REG_FIRST 67
#define ST_REG_LAST 74
#define ST_REG_NUM (ST_REG_LAST - ST_REG_FIRST + 1)
OpenPOWER on IntegriCloud