On Tue, 11 Feb 2014, Jakub Jelinek wrote:

> Hi!
> 
> Right now we spent several minutes in verify_tree.  The problems I see
> is that merge_tlist does the exact opposite of what should it be doing with
> copy flag (most merge_tlist calls are with copy=0, thus that means mostly
> unnecessary copying, but for the single one for SAVE_EXPR it actually
> probably breaks things or can break), the middle-hunk is about one spot
> which IMHO uses copy=1 unnecessarily (nothing uses tmp_list2 afterwards).
> 
> The most important is the last hunk, the SAVE_EXPR handling was doing
> merge_tlist first on the whole tmp_nosp chain (with copy=0 which mistakenly
> copied everything, see above), and then doing that again with the whole
> tmp_nosp list except the first entry, then except the first two entries etc.
> O(n^2) complexity, but IMHO none of the calls but the first one actually
> would do anything, because after the first merge_tlist call all entries
> should be actually in tmp_list3 (except for duplicates), and so for all
> further entries it would be finding a matching entry already (found=1).
> 
> With this patch pr60101.c compiles within less than a second.
> 
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

OK.

-- 
Joseph S. Myers
jos...@codesourcery.com

Reply via email to