From: hubicka Date: Tue, 13 Apr 2010 18:22:35 +0000 (+0000) Subject: * ipa-inline.c (cgraph_mark_inline_edge): Avoid double accounting X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=commitdiff_plain;h=ebfcc251953ee26534a35e75cb35eeb4d08f503a * ipa-inline.c (cgraph_mark_inline_edge): Avoid double accounting of optimized out static functions. (cgraph_edge_badness): Add DUMP parameter and dump reasons for the cost computation. Also sanity check for overflows. (update_caller_keys): Update cgraph_edge_badness call; properly update fibheap and sanity check that it is up to date. (add_new_edges_to_heap): Update cgraph_edge_badness. (cgraph_decide_inlining_of_small_function): Likewise; add sanity checking that badness in heap is up to date; improve dumping of reason; Update badness of calls to the offline copy of function currently inlined; dump badness of functions not inlined because of unit growth limits. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158278 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 402cb10e74e..903650c868c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,18 @@ +2010-04-13 Jan Hubicka + + * ipa-inline.c (cgraph_mark_inline_edge): Avoid double accounting + of optimized out static functions. + (cgraph_edge_badness): Add DUMP parameter and dump reasons for the + cost computation. Also sanity check for overflows. + (update_caller_keys): Update cgraph_edge_badness call; properly + update fibheap and sanity check that it is up to date. + (add_new_edges_to_heap): Update cgraph_edge_badness. + (cgraph_decide_inlining_of_small_function): Likewise; + add sanity checking that badness in heap is up to date; + improve dumping of reason; Update badness of calls to the + offline copy of function currently inlined; dump badness + of functions not inlined because of unit growth limits. + 2010-04-13 Eric Botcazou PR middle-end/32628 diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index 36d455d9bd1..3162b694e15 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -313,6 +313,10 @@ cgraph_mark_inline_edge (struct cgraph_edge *e, bool update_original, e->inline_failed = CIF_OK; DECL_POSSIBLY_INLINED (e->callee->decl) = true; + if (!e->callee->global.inlined) + DECL_POSSIBLY_INLINED (e->callee->decl) = true; + e->callee->global.inlined = true; + cgraph_clone_inlined_nodes (e, true, update_original); what = e->callee; @@ -542,9 +546,6 @@ cgraph_edge_badness (struct cgraph_edge *edge, bool dump) (cgraph_estimate_size_after_inlining (1, edge->caller, edge->callee) - edge->caller->global.size); - if (edge->callee->local.disregard_inline_limits) - return INT_MIN; - if (dump) { fprintf (dump_file, " Badness calculcation for %s -> %s\n", @@ -1206,9 +1207,8 @@ cgraph_decide_inlining_of_small_functions (void) " Estimated growth after inlined into all callees is %+i insns.\n" " Estimated badness is %i, frequency %.2f.\n", cgraph_node_name (edge->caller), - flag_wpa ? "unknown" - : gimple_filename ((const_gimple) edge->call_stmt), - flag_wpa ? -1 : gimple_lineno ((const_gimple) edge->call_stmt), + gimple_filename ((const_gimple) edge->call_stmt), + gimple_lineno ((const_gimple) edge->call_stmt), cgraph_estimate_growth (edge->callee), badness, edge->frequency / (double)CGRAPH_FREQ_BASE);