From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 125991 invoked by alias); 9 Mar 2015 11:33:52 -0000 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 Received: (qmail 125941 invoked by uid 48); 9 Mar 2015 11:33:49 -0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/44563] GCC uses a lot of RAM when compiling a large numbers of functions Date: Mon, 09 Mar 2015 11:33:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 4.3.4 X-Bugzilla-Keywords: compile-time-hog, memory-hog X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-03/txt/msg00922.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44563 --- Comment #16 from Richard Biener --- callgrind shows the cgraph_edge_hasher quite high in the profile (via redirect_all_calls). I suppose as the large main is a single BB walking all stmts over-and-over is quite bad. Also hash_pointer isn't inlined!? Ah - it's external in libiberty hashtab.c ... - it should transition to using/inheriting from pointer_hash. cgraph_edge * cgraph_node::get_edge (gimple call_stmt) { cgraph_edge *e, *e2; int n = 0; if (call_site_hash) return call_site_hash->find_with_hash (call_stmt, htab_hash_pointer (call_stmt)); The estimate_calls_size_and_time portion is quite smaller. cleanup-cfgs main portion is split_bb_on_noreturn_calls.