From 251270426a6dbb650f4dca6f2cb10924957e5f53 Mon Sep 17 00:00:00 2001 From: David Daney Date: Thu, 18 Oct 2007 16:43:52 +0000 Subject: [PATCH] linux-unwind.h (mips_fallback_frame_state): Use new reg_offset variable to calculate register locations. gcc/ 2007-10-17 David Daney * config/mips/linux-unwind.h (mips_fallback_frame_state): Use new reg_offset variable to calculate register locations. From-SVN: r129446 --- gcc/ChangeLog | 5 +++++ gcc/config/mips/linux-unwind.h | 12 +++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e93e4cb9150c..125ae4580f74 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2007-10-18 David Daney + + * config/mips/linux-unwind.h (mips_fallback_frame_state): Use new + reg_offset variable to calculate register locations. + 2007-10-18 Richard Guenther * tree-ssa.c (uid_ssaname_map_eq): New function. diff --git a/gcc/config/mips/linux-unwind.h b/gcc/config/mips/linux-unwind.h index dee77035fec6..ed0a84b2db32 100644 --- a/gcc/config/mips/linux-unwind.h +++ b/gcc/config/mips/linux-unwind.h @@ -52,7 +52,7 @@ mips_fallback_frame_state (struct _Unwind_Context *context, { u_int32_t *pc = (u_int32_t *) context->ra; struct sigcontext *sc; - _Unwind_Ptr new_cfa; + _Unwind_Ptr new_cfa, reg_offset; int i; /* 24021061 li v0, 0x1061 (rt_sigreturn)*/ @@ -85,22 +85,24 @@ mips_fallback_frame_state (struct _Unwind_Context *context, else return _URC_END_OF_STACK; - new_cfa = (_Unwind_Ptr)sc; + new_cfa = (_Unwind_Ptr) sc; fs->regs.cfa_how = CFA_REG_OFFSET; fs->regs.cfa_reg = STACK_POINTER_REGNUM; fs->regs.cfa_offset = new_cfa - (_Unwind_Ptr) context->cfa; -#if _MIPS_SIM == _ABIO32 && defined __MIPSEB__ /* On o32 Linux, the register save slots in the sigcontext are eight bytes. We need the lower half of each register slot, so slide our view of the structure back four bytes. */ - new_cfa -= 4; +#if _MIPS_SIM == _ABIO32 && defined __MIPSEB__ + reg_offset = 4; +#else + reg_offset = 0; #endif for (i = 0; i < 32; i++) { fs->regs.reg[i].how = REG_SAVED_OFFSET; fs->regs.reg[i].loc.offset - = (_Unwind_Ptr)&(sc->sc_regs[i]) - new_cfa; + = (_Unwind_Ptr)&(sc->sc_regs[i]) + reg_offset - new_cfa; } /* The PC points to the faulting instruction, but the unwind tables expect it point to the following instruction. We compensate by -- 2.47.2