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: Question on fixup_abnormal_edges


> Hi,
> 
> On Wed, 16 Oct 2002, Jan Hubicka wrote:
> 
> > EH edges are abnormal and can be critical.  You can add insns to them,
> > if you update split_edge.
> 
> But then the exception tables need to be updated too, or?  I mean you have
> to split such an edge, create a new BB, and somehow make that the landing
> target for the exceptions.
Yes.  This is possible to do, just bit dificult and that why we don't do
that.
> 
> > (ie teoretically it is possible, but our current framework can't deal
> > with these) It can be good idea to add code for that, as GCSE would be
> > much happier then too.
> >
> > I think that EH kills registers anyway, so this is not problem.
> >
> > I think problem is different.  The call with live register over is
> > noreturn, so there should really be no register alive at first place.
> 
> Yes and no.  Because it's an throwing call the noreturn hint is not
> exactly correct.  It doesn't return when it's not throwing, but if it
> does, it returns and follows the EH edge.  Having registers live over EH
> edges is OK, they just should not be allocated to hardregs which are
> destroyed by EH.

This is interesting.  Richard told me when I was working on reg-stack
that the variables live across EH edges and not in registers.

Perhaps this is just because stack registers are not live across the
calls after regalloc, but then it would be wrong at least for Java
non-call-exceptions.

So I believe register global register should be live accross something
that do throw only when it is used by the non-throwing path that is
empty in this case.

I have to find time to investigate more :(

  /* Care for non-call EH edges specially.  The normal return path have
     values in registers.  These will be popped en masse by the unwind
     library.  */
  if ((e->flags & (EDGE_EH | EDGE_ABNORMAL_CALL)) == EDGE_EH)
    target_stack->top = -1;

  /* Other calls may appear to have values live in st(0), but the
     abnormal return path will not have actually loaded the values.  */
  else if (e->flags & EDGE_ABNORMAL_CALL)
    {
      /* Assert that the lifetimes are as we expect -- one value
         live at st(0) on the end of the source block, and no
         values live at the beginning of the destination block.  */
      HARD_REG_SET tmp;

      CLEAR_HARD_REG_SET (tmp);
      GO_IF_HARD_REG_EQUAL (target_stack->reg_set, tmp, eh1);
      abort ();
    eh1:

      SET_HARD_REG_BIT (tmp, FIRST_STACK_REG);
      GO_IF_HARD_REG_EQUAL (regstack.reg_set, tmp, eh2);
      abort ();
    eh2:

      target_stack->top = -1;
    }

Honza
> 
> 
> Ciao,
> Michael.


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