This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: needless deep recursion in gt-c-decl.h
> Date: Mon, 05 Aug 2002 14:34:42 -0700
> From: Per Bothner <per@bothner.com>
> Geoff Keating wrote:
> > I think I described in a previous e-mail how the one-loop
> > algorithm doesn't work; IIRC it went like:
> >
> > originally: 24000 maximum nesting on expr.o
> > one loop: 16000
> > two loops: 9000
> > three loops: 800
Now that I looked up my previous mail to check, it was actually:
originally: 24000
one-loop method applied to tree marking routine only: 16000
two-loop method applied to tree marking routine only: 16000
one-loop method applied to both trees & rtl: 13000
two-loop method applied to both: 10000
two-loop method on trees, three-loop method on rtl: 800
> To quote from your previous email:
>
> > I tried both algorithms on the tree marker routine for C. They both
> > had about the same effect, reducing the recursion depth to about
> > 16000, with no significant change in CPU time.
> > ...
> > The 16000 turns out to be mostly RTL marking.
By 'mostly RTL', I meant that there was some rtvec marking too. The
bottom two or three levels might have been tree marking, but not
enough to be significant.
> I.e. most of the recursion depth when marking *tree nodes*
> consists of marking *rtl modes*.
That doesn't follow. The code path to the maximum depth may have
moved; it might have been 24k levels of trees originally, but 16k
levels of RTL with either the one-loop or two-loop methods applied to
the tree marker.
> I'm suggesting that we don't need to mark rtl nodes while we're
> marking tree nodes. Don't recurse into rtl from tree - we'll get to
> the rtl from the other roots anyway.
This won't avoid the LABEL_REF. It will be encountered the first time
it's used in RTL, which will still be much earlier than the position
of the label.
> In that case your results suggest that a one-loop method is might
> work fine.
I see no evidence for this.
--
- Geoffrey Keating <geoffk@geoffk.org> <geoffk@redhat.com>