needless deep recursion in gt-c-decl.h

Geoff Keating geoffk@geoffk.org
Tue Jul 30 21:41:00 GMT 2002


> Date: Thu, 25 Jul 2002 16:35:19 -0700
> From: Per Bothner <per@bothner.com>

I am still working on this...

One problem is that to make this change:

> @@ -50,44 +52,36 @@
>        {
>          unsigned int tag2 = (tree_node_structure (&((*x).generic)));
>          if (tag2 == (TS_COMMON)) {
> -          gt_ggc_m_tree_node ((*x).generic.common.chain);
>            gt_ggc_m_tree_node ((*x).generic.common.type);
>          }
>          if (tag2 == (TS_INT_CST)) {
> -          gt_ggc_m_tree_node ((*x).generic.int_cst.common.chain);
>            gt_ggc_m_tree_node ((*x).generic.int_cst.common.type);
>            gt_ggc_m_rtx_def ((*x).generic.int_cst.rtl);
>          }
...

would require teaching gengtype that common.chain is the same as
int_cst.common.chain and so on.  I now remember that I never tested
this particular algorithm, for this reason.  Annoyingly, it's only a
problem with trees, RTL and almost all the other structures don't have
this problem.

Do you know what the actual stack limits are on Darwin?  I now have an
instrumented GCC that reports the maximum recursion, but each stack
frame is small (I would expect 32 bytes on powerpc) so you can fit an
awful lot of them in a few Mb of stack.

Once my initial run completes I'll know what source files cause the
highest recursion.  Then I will apply your patch and a two-loop patch
and see what happens with speed & space.

-- 
- Geoffrey Keating <geoffk@geoffk.org> <geoffk@redhat.com>



More information about the Gcc mailing list