c++/1687: Extreme compile time regression from 2.95.2

Scott A Crosby crosby@qwes.math.cmu.edu
Wed Feb 14 03:07:00 GMT 2001


On Tue, 6 Feb 2001, Zack Weinberg wrote:

> Using the 'visit each node only once' mechanism of walk_tree
> thoroughly squelches the performance problem.  (One can't use
> walk_tree_without_duplicates blindly - slightly more cleverness is
> required.  It's still simple.)  We get sub-second compile time all the
> way up to -O2 and 32 input mux().

> HOWEVER: I am not certain that the change is correct.  Suppose that a
> function A is a candidate for inlining, and it's called twice from the
> same function B.  If the two call_expr nodes are shared, we won't
> inline both calls.  There may be other problems as well.
> 
> Patch follows.  Commentary from C++ team appreciated.  Will bootstrap
> and report.


Could you workaround this by walking the tree normally, and try to inline
at all of the nodes, but if you find out that you are scanning too many
nodes, you abort and use a workaround strategy, say, walk-each-node once?

Catch the pathalogical cases and shunt them elsewhere, and behave normally
otherwise?

Scott



More information about the Gcc-bugs mailing list