This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFA: Fix MIPS/Linux unwinding for big-endian


Daniel Jacobowitz <drow@false.org> writes:
> 	* config/mips/linux-unwind.h (mips_fallback_frame_state): Adjust
> 	offsets for the big-endian 32-bit case.

OK, but...

> +#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;
> +#endif

...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.

Richard


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]