This is the mail archive of the gcc@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: EH newbies howto


> > set (mem:SI 
> >         (plus:SI (reg:SI SP) (const_int 8)) 
> >         (reg:SI 8 )) 
> 
> One space too many :) (there's a few more of these further down.)

fixed.  thanks.

> > __Unwind_RaiseException() is processed in a special way.  First, it is
> > compiled such that every possible preserved register is saved in the
> > prologue and restored in the epilogue.
> 
> I've looked for fifteen minutes or so and I can't find anything
> special in targets or in the compiler proper which causes this to
> happen. How's this magic done?

_Unwind_RaiseException calls uw_init_context().  this is defined as a macro
in unwind-dw2.c which calls __builtin_unwind_init().

expand_builtin_unwind_init() sets current_function_has_nonlocal_label.

if you look at reload(), you'll notice this:

  /* A function that receives a nonlocal goto must save all call-saved
     registers.  */
  if (current_function_has_nonlocal_label)
    for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
      if (! call_used_regs[i] && ! fixed_regs[i] && ! LOCAL_REGNO (i))
        regs_ever_live[i] = 1;

...which sets the preserved registers live.  this causes the prologue
and epilogue code to save/restore these registers.

perhaps i should add this to the document.

aldy


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