GCC memory consumption increased by recent patch!

Kenneth Zadeck zadeck@naturalbridge.com
Wed Sep 15 13:27:00 GMT 2004


>1GB of memory is still a lot even when it is much less than what GCC
>would need.  I am pretty sure ICC can get around doing IPA without
>actually allocating as much memory as all the .o files takes together.
>  
>
>Concerning GCC memory, we need about 700MB of memory to compile GCC
>backend itself.   We do have serious problems then because the GGC
>  
>
Websphere is several orders of magnitude larger than gcc's back end.  It 
is over 1gb of compiled code.

>overhead increase out of resonable bounds (so we burn about 70% of
>compilation time in GGC as long as I can reacall) and these things get
>yet worse when machine goes to swap.
>  
>
>I will take a homework and look how other available production C
>compilers (at least SGIpro) are dealing with this problem.
>
>  
>
Most optimizing compilers are able to do full unit at a time 
compilation.  Furthermore, those compilers that do link time 
optimization are clearly doing it.  For the most part the link time 
optimizers are just the regular optimizer that has been hacked with a 
front end that reads the special .o information.

>>If this is what I have to do for now, this is what I will do.  I had 
>>just thought that there was more here.
>>    
>>
>
>For 4.0 lets don't change basic ordering of the passes - I have very bad
>experiences with these kind of changes that should just work but usually
>just break everything.  We should do more experimenting on
>tree-profiling branch.  Perhaps I can get it working there as an
>alternative option (-ftwo-pass-ipa) and we can see how much it will pay
>back?
>
>  
>
Just to get back to basics.  I started looking at the cgraph code to see 
how to fix this now for this release.  I have a few questions. 

There does not appear to be any flag or fields that say who is the 
master version and who is the clone.
I saw some code that took the node->decl field and passed it to 
cgraph_node so as to look it up in the hash table.  Does this mean that 
the node in the hash table is the master and that the best you can do is 
do the lookup and see if you are yourself?

Do you ever have the case where there is no master?  i.e. if all calls 
to the function are inlined, does the master go away?

Kenny



More information about the Gcc-regression mailing list