This is the mail archive of the
mailing list for the GCC project.
Re: RFA: Fix MIPS/Linux unwinding for big-endian
- From: Richard Sandiford <rsandifo at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 07 Feb 2005 09:16:59 +0000
- Subject: Re: RFA: Fix MIPS/Linux unwinding for big-endian
- References: <20050203184853.GA31399@nevyn.them.org>
Daniel Jacobowitz <email@example.com> writes:
> * config/mips/linux-unwind.h (mips_fallback_frame_state): Adjust
> offsets for the big-endian 32-bit case.
> +#if defined _ABIO32 && _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;
...there shouldn't be any need to check "defined _ABIO32" in this
context. The compiler will always define _MIPS_SIM to a nonzero value.
Also, I'd slightly prefer having a new variable or macro that gives
the offset of a register within its entry. I.e. something like:
#define REG_OFFSET 4
(_Unwind_Ptr)&(sc->sc_regs[i]) + REG_OFFSET - new_cfa;
(_Unwind_Ptr)&(sc->sc_pc) + REG_OFFSET - new_cfa;
It's more lines of code, but IMO its more readable, and it avoids having
a variable called new_cfa that doesn't actually contain a cfa as such.
But that's just micromanagement on my part. Patch is OK with
with "defined _ABIO32" removed, whether or not you make the
second change as well.