On Thu, Jun 30, 2011 at 10:37 AM, H.J. Lu wrote: > On Thu, Jun 30, 2011 at 9:08 AM, H.J. Lu wrote: >> On Thu, Jun 30, 2011 at 8:03 AM, Jason Merrill wrote: >>> On 06/30/2011 10:42 AM, H.J. Lu wrote: >>>> >>>> Register may be saved/restored either by address or value. My patch >>>> doesn't change the reg field.  The other way will be >>>> >>>> #ifdef USE_UNWIND_WORD >>>>     _Unwind_Word reg[DWARF_FRAME_REGISTERS+1]; >>>> #else >>>>      void *reg[DWARF_FRAME_REGISTERS+1]; >>>> #endif >>>> >>>> We need it so that we are binary compatible with the existing >>>> unwind context.  Once we do that we need many >>>> >>>> #ifdef USE_UNWIND_WORD >>>> #endif >>>> >>>> whenever the reg field is accessed since the reg field is changed. >>> >>> But your patch already changes all but one place where reg is accessed.  And >>> we can avoid lots of ifdefs by abstraction with macros/inlines so there's >>> one interface. >> >> I can do that. >> >>> Also, why change SIGNAL_FRAME_BIT? >>> >> >> The current one is >> >>  /* Signal frame context.  */ >> #define SIGNAL_FRAME_BIT ((~(_Unwind_Word) 0 >> 1) + 1) >> >> It is defined such a strange way to be binary backward compatible. >> Since there is no such a problem with if REG_VALUE_IN_UNWIND_CONTEXT >> is defined, I simply define it as >> >>  /* Signal frame context.  */ >> #define SIGNAL_FRAME_BIT ((_Unwind_Word) 1 >> 0) >> > > Here is the updated patch.  OK for trunk if there are no regressions? > > Thanks. > > -- > H.J. > --- > gcc/ > > 2011-06-30  H.J. Lu   > >        * config.gcc (libgcc_tm_file): Add i386/value-unwind.h for >        Linux/x86. > >        * system.h (REG_VALUE_IN_UNWIND_CONTEXT): Poisoned. > >        * unwind-dw2.c (_Unwind_Context_Reg_Val): New. >        (_Unwind_Get_Unwind_Word): Likewise. >        (_Unwind_Get_Unwind_Context_Reg_Val): Likewise. >        (_Unwind_Context): Use _Unwind_Context_Reg_Val on the reg field. >        (SIGNAL_FRAME_BIT): Define if REG_VALUE_IN_UNWIND_CONTEXT is >        defined. >        (_Unwind_IsExtendedContext): Likewise. >        (EXTENDED_CONTEXT_BIT): Don't define if REG_VALUE_IN_UNWIND_CONTEXT >        is defined. >        (_Unwind_GetGR): Updated. >        (_Unwind_SetGR): Likewise. >        (_Unwind_GetGRPtr): Likewise. >        (_Unwind_SetGRPtr): Likewise. >        (_Unwind_SetGRValue): Likewise. >        (_Unwind_GRByValue): Likewise. >        (__frame_state_for): Likewise. >        (uw_install_context_1): Likewise. > >        * doc/tm.texi.in: Document REG_VALUE_IN_UNWIND_CONTEXT. >        * doc/tm.texi: Regenerated. > > libgcc/ > > 2011-06-30  H.J. Lu   > >        * config/i386/value-unwind.h: New. > config.gcc has some extra changes for x32 and missed doc changes. This one fixed them. Sorry for that. -- H.J.