This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: the size of tree_decl
- From: Dan Nicolaescu <dann at ics dot uci dot edu>
- To: law at redhat dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 12 Feb 2003 12:22:50 -0800
- Subject: Re: the size of tree_decl
- References: <200302120643.h1C6hKQc010069@localhost.redhat.com>
law@redhat.com writes:
> In message <200302102217.h1AMHvkA027073@gremlin.ics.uci.edu>, Dan Nicolaescu wr
> ites:
> >
> >tree_decl is a big structure (108 bytes on x86), a lot of tree_decls are
> >created during a compilation and a lot more are created on the
> >tree-ssa branch.
> >
> >It seems that there are some things in a tree_decl that could be
> >placed somewhere else, and save some space that way.
> I'm all for it :-)
Great!
>
> > tree vindex; -- seems to be only used in C++ and java
> >Can it be moved to the language specific part of the decl?
> Hmm, I'm somewhat surprised it's not used by Obj-C. No strong
> opinions here.
I am not too sure, I just grepped for vindex, and there were no hits
in the objc directory...
There's another field that is too big: location_t locus, it contains
a line number and a char*. If it was to use logical lines like cpplib
does, the char*
Some numbers to show why keeping tree_decl small is important.
cc1 -O2 combine.i
Memory allocated for decls: 987336 bytes
Total ggc alocated memory 5372k
ie 18% of the ggc memory is allocated for tree_decls
for C++:
cc1plus -O2 generate-3.4.ii (from Gerald Pfeifer's PR 8361, I have no
idead how typical that code is)
Memory allocated for decls: 15630408 bytes
Total ggc alocated memory: 48M
ie 31% of the ggc memory is allocated for tree_decls
--dan