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: [Patch] MIPS: Fix unwinding through signal frames for n32 and n64 ABIs.


David Daney <ddaney@avtrex.com> writes:
> Daniel Jacobowitz wrote:
>> On Mon, Jul 09, 2007 at 09:36:38PM +0100, Richard Sandiford wrote:
>>> Either way, the change is going to extend the ABI -- DWARF register 66
>>> should not be used for other purposes going forward -- and I think
>>> defining DWARF_ALT_FRAME_RETURN_COLUMN makes that a little more
>>> explicit.
>> 
>> Is there some way we can do this without entrenching it in the ABI?
>> 
>> It seems to me like we ought to be able to, unless I'm mistaken about
>> how this all fits together.  We can only unwind registers that the
>> unwinder knows about when it is built.  So if it simply ignores
>> numbers outside that range from unwind tables, we can pick the next
>> value and use internally.
>> 
>
> The only aspect of it that is not completely localized to the unwinder 
> in libgcc is the part where I force the width of the 
> SIGNAL_UNWIND_RETURN_COLUMN register to be Pmode.
>
> As long as we never put some hard register that we expect the unwinder 
> to have to deal with in that column, we are fine.  The ABI compatibility 
> issues seem to me to be quite minor.

Well, by "other purpose", I only meant "something other than a Pmode
register".  It sounds like everyone's agreed that we're extending
the ABI in that sense.  And if all you want is to do is reserve a
Pmode DWARF register, D_A_F_R_C is your man.  Indeed, I believe
it was originally added specifically because signal frames might
use a different register from unwind tables:

    @defmac DWARF_ALT_FRAME_RETURN_COLUMN
    A C expression whose value is an integer giving a DWARF 2 column
    number that may be used as an alternative return column.  The column
    must not correspond to any gcc hard register (that is, it must not
    be in the range of @code{DWARF_FRAME_REGNUM}).

    This macro can be useful if @code{DWARF_FRAME_RETURN_COLUMN} is set to a
    general register, but an alternative column needs to be used for signal
    frames.  Some targets have also used different frame return columns
    over time.
    @end defmac

For reference, the documentation used to be:

    @defmac DWARF_ALT_FRAME_RETURN_COLUMN
    A C expression whose value is an integer giving a DWARF 2 column
    number that may be used as an alternate return column.  This should
    be defined only if @code{DWARF_FRAME_RETURN_COLUMN} is set to a
    general register, but an alternate column needs to be used for
    signal frames.
    @end defmac

but we made it slightly more general for m68k.

Richard


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