From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Zack Weinberg" To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org Subject: Re: c++/1687: Extreme compile time regression from 2.95.2 Date: Sun, 01 Apr 2001 00:00:00 -0000 Message-id: <20010214210601.13270.qmail@sourceware.cygnus.com> X-SW-Source: 2001-q1/msg01263.html List-Id: The following reply was made to PR c++/1687; it has been noted by GNATS. From: "Zack Weinberg" To: Scott A Crosby Cc: Kelley Cook , gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org Subject: Re: c++/1687: Extreme compile time regression from 2.95.2 Date: Wed, 14 Feb 2001 13:00:49 -0800 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