From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24153 invoked by alias); 26 Jun 2012 14:58:57 -0000 Received: (qmail 24142 invoked by uid 22791); 26 Jun 2012 14:58:56 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED,TW_TM X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 26 Jun 2012 14:58:34 +0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/38474] slow compilation at -O0 due to expand's temp slot goo Date: Tue, 26 Jun 2012 14:58:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Keywords: compile-time-hog, memory-hog, patch X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: REOPENED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: matz at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-06/txt/msg01737.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38474 --- Comment #63 from Richard Guenther 2012-06-26 14:58:31 UTC --- (In reply to comment #61) > (In reply to comment #57) > > > > I will, on Monday. > > And by Monday I obviously meant yesterday ;-) > > Anyway, on the machine where are debugged this, compilation at -O3 > took over 16 seconds which dropped to about 13.5 seconds when I also > added -fno-devirtualize (-ftime-report showed that alias stmt walking > dropped from 82% to 75%). This is mainly due to calls to > detect_type_change from compute_known_type_jump_func, there are 36454 > of them and all are of course completely pointless because we do not > devirtualize in Fortran. > > Looking into the code, it is apparent that I even attempted to avoid > such situations but somehow was not paying enough attention. The > rather obvious patch below fixes that. With it, the compile time at > -O3 drops to 13.5 without any additional options (~50 calls to > detect_type_change_ssa and detect_type change from other places remain > but those are not a big problem here, they are not so easy to get rid > of and I hope to eventually remove the type detection machinery from > IPA altogether so I'll keep those for later). > > I'll bootstrap and test the patch and post it to the mailing list > soon. > > Index: gcc/ipa-prop.c > =================================================================== > --- gcc/ipa-prop.c (revision 188931) > +++ gcc/ipa-prop.c (working copy) > @@ -912,8 +912,8 @@ compute_known_type_jump_func (tree op, s > || is_global_var (base)) > return; > > - if (detect_type_change (op, base, call, jfunc, offset) > - || !TYPE_BINFO (TREE_TYPE (base))) > + if (!TYPE_BINFO (TREE_TYPE (base)) > + || detect_type_change (op, base, call, jfunc, offset)) > return; That change qualifies for a backport to all branches it applies to ...