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: RFC Patch: Fix bad eh_frame data for MIPS.


> Doing this will fail in the case of a leaf function where r31 is not 
> saved on the stack.

No it won't.  Have you tried it?  It works just fine on alpha and powerpc.

> When unwinding through a signal handler we must restore all the 
> registers (including r31) however if we use r31 as the 
> DWARF_FRAME_RETURN_COLUMN then it must have the value of the return 
> address from the signal handler (i.e. the address of the faulting 
> instruction).  Unwinding then fails in the leaf function because r31 has 
> the wrong value.

Note that the frame return column can be different for *every* frame.

Note that MD_FALLBACK_FRAME_STATE_FOR for alpha-linux does *not* use
column 26 for the return address.

> It seems that initial_return_save in the REG case is writing a mapping 
> of the "real return address register"-> DWARF_FRAME_RETURN_COLUMN into 
> the CIE.  If this is true, then reg must be the real register number, 
> not the DWARF_FRAME_REGNUM.

You should know that a good part of what DWARF_FRAME_REGNUM does
is map gcc register numbers to dwarf2 register numbers.  There is
not always a 1-1 correspondence.  Thus removing it would be wrong.

It should *not* be used for mapping a hard register onto the
frame return column.


r~


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