This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/1687: Extreme compile time regression from 2.95.2
On Wed, Feb 14, 2001 at 06:07:08AM -0500, Scott A Crosby wrote:
> 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?
Let's find out if always walking each node once is safe, first. It
doesn't cause any C++ regressions, but I still don't know if it
inhibits optimizations. Paging C++ team...
zw