This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Ada and the TREE_COMPLEXITY field on struct tree_exp
- From: "Steven Bosscher" <stevenb dot gcc at gmail dot com>
- To: "Richard Kenner" <kenner at vlsi1 dot ultra dot nyu dot edu>
- Cc: ebotcazou at libertysurf dot fr, gcc at gcc dot gnu dot org
- Date: Thu, 18 Jan 2007 13:16:07 +0100
- Subject: Re: Ada and the TREE_COMPLEXITY field on struct tree_exp
- References: <200701180921.34004.steven@gcc.gnu.org> <10701181211.AA14514@vlsi1.ultra.nyu.edu>
On 1/18/07, Richard Kenner <kenner@vlsi1.ultra.nyu.edu> wrote:
> Ada is the last user of the tree_exp->complexity field. Removing
> this field should reduce GCC's memory usage by about 5% on a 64 bit
> host. Could an Ada maintainer see if it possible to remove the use
> of this field? I would think it shouldn't be too hard --
> TREE_COMPLEXITY is used only inside ada/decl.c. But I haven't been
> able to figure out myself yet how to avoid using TREE_COMPLEXITY there...
It's just being used as a cache to avoid recomputing a value. My
suggestion would be to replace it with a hash table. It'll tend to keep nodes
around a little more than usual, but that should be a tiny cost.
I had thought of a hash table, too, but I couldn't figure out where to
initialize and free it (i.e. where it is a "live" table, so to speak).
For example, I don't know if this table would be required after
gimplification, and I also don't even know how GNAT translates its own
representation to GIMPLE (whole translation unit at once? function at
a time?).
Gr.
Steven