memory is not free

Mike Stump mrs@windriver.com
Fri Dec 31 16:38:00 GMT 1999


> Date: Wed, 1 Dec 1999 19:10:59 -0800
> From: Richard Henderson <rth@cygnus.com>

> On Wed, Dec 01, 1999 at 12:09:50AM -0800, Alex Samuel wrote:
> > ! 	    case 'e': case 'u':
> > ! 	      exp = XEXP (r, i);
> > ! 	      if (ggc_test_and_set_mark (exp))
> > ! 		{ 
> > ! 		  if (next_rtx == NULL) 
> > ! 		    next_rtx = exp; 
> > ! 		  else 
> > ! 		    ggc_mark_rtx_children (exp);
> > ! 		} 

> We might want to special-case the instruction rtxes.  I would imagine
> that we could keep the nesting depth significantly lower by forcing
> NEXT_INSN to be the rtx we optimize for the tail call.

:-) My code was exceptionally clear.  You knew that 1 was the tail
recursive case.  His code behaves _exactly_ like mine (in all the ways
that matter), though I had to think about it for a while before I
convinced myself this _was_ the case.  The reason is that 0 is an int,
1 is first one that hit this code.  1 is the important one, as start
marking with the return insn (artifact of other parts of the GC code),
and work backwards (recursing).  So while NEXT_INSN _seems_ like the
right one, it is not.  PREV_INSN is.  Anyway, his code is more robust
than my version, as if one day we need to walk the other direction, his
code will just work.

Welcome to gcc.



More information about the Gcc-patches mailing list