This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: Use _Unwind_Ptr (Was: Re: RFC / RFA: dwarf2 unwinding for targets with call-part-clobbered registers)
- From: Richard Henderson <rth at redhat dot com>
- To: Joern Rennecke <joern dot rennecke at superh dot com>
- Cc: Jim Wilson <wilson at tuliptree dot org>, gcc at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Thu, 10 Jul 2003 10:24:31 -0700
- Subject: Re: RFA: Use _Unwind_Ptr (Was: Re: RFC / RFA: dwarf2 unwinding for targets with call-part-clobbered registers)
- References: <20030709212618.GA16029@redhat.com> <200307101618.h6AGIpc10104@linsvr1.uk.superh.com>
On Thu, Jul 10, 2003 at 05:18:51PM +0100, Joern Rennecke wrote:
> * unwind.h (_Unwind_GetPtr): Declare.
> * unwind-dw2.c (_Unwind_SavedPtr): Provide default definition.
> (_Unwind_GetPtr): New function.
> (uw_update_context_1): Use it. Use _Unwind_SavedPtr for type of
> tmp_sp.
> (uw_update_context, uw_install_context_1): Use _Unwind_GetPtr.
> (uw_init_context_1): Likewise. Use _Unwind_SavedPtr for type of
> sp_slot.
Hum. I'm not thrilled. And I think it may miss out on external
users of _Unwind_GetGR etc.
I like the _Unwind_GetPtr, for sure, for internal use. I think it
should return void* instead of _Unwind_Ptr; all uses wind up casting
anyway, and that's a nice cleanup.
However, can we do something like
_Unwind_Word
_Unwind_GetGR (struct _Unwind_Context *context, int index)
{
int uw_index = DWARF_REG_TO_UNWIND_COLUMN (index);
int size = dwarf_reg_size_table[index];
void *ptr = context->reg[uw_index];
if (size == sizeof(_Unwind_Ptr))
return * (_Unwind_Ptr *) ptr;
if (size == sizeof(_Unwind_Word))
return * (_Unwind_Word *) ptr;
abort ();
}
static inline void *
_Unwind_GetPtr (struct _Unwind_Context *context, int index)
{
return (void *)(_Unwind_Ptr) _Unwind_GetGR (context, index);
}
Similar changes for _Unwind_SetGR. We'll need to move the initialization
of dwarf_reg_size_table, and I do recognize that this depends on your other
patch to __builtin_init_dwarf_reg_size_table.
r~