This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: the size of tree_decl


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]