From 317a06466502c2c929f06927c98a0dac33f24ea0 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Mon, 13 Jun 2011 15:34:59 +0000 Subject: [PATCH] ipa-inline.c (reset_edge_caches): Walk aliases. * ipa-inline.c (reset_edge_caches): Walk aliases. (update_caller_keys): Do not test inlinability of aliases. * ipa-inline-analysis.c (do_estimate_edge_time): Look through alias. (do_estimate_growth): Fix typo. From-SVN: r174992 --- gcc/ipa-inline-analysis.c | 4 ++-- gcc/ipa-inline.c | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/gcc/ipa-inline-analysis.c b/gcc/ipa-inline-analysis.c index 43e0f8124d0..b008f05c972 100644 --- a/gcc/ipa-inline-analysis.c +++ b/gcc/ipa-inline-analysis.c @@ -2079,7 +2079,7 @@ do_estimate_edge_time (struct cgraph_edge *edge) struct inline_edge_summary *es = inline_edge_summary (edge); gcc_checking_assert (edge->inline_failed); - estimate_node_size_and_time (edge->callee, + estimate_node_size_and_time (cgraph_function_or_thunk_node (edge->callee, NULL), evaluate_conditions_for_edge (edge, true), &size, &time); @@ -2226,7 +2226,7 @@ do_estimate_growth (struct cgraph_node *node) else { if (!DECL_EXTERNAL (node->decl) - && !cgraph_will_be_removed_from_program_if_no_direct_calls (node)) + && cgraph_will_be_removed_from_program_if_no_direct_calls (node)) d.growth -= info->size; /* COMDAT functions are very often not shared across multiple units since they come from various template instantiations. Take this into account. */ diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index a2e55b981b7..c9328c91053 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -929,6 +929,8 @@ reset_edge_caches (struct cgraph_node *node) struct cgraph_edge *edge; struct cgraph_edge *e = node->callees; struct cgraph_node *where = node; + int i; + struct ipa_ref *ref; if (where->global.inlined_to) where = where->global.inlined_to; @@ -939,6 +941,9 @@ reset_edge_caches (struct cgraph_node *node) for (edge = where->callers; edge; edge = edge->next_caller) if (edge->inline_failed) reset_edge_growth_cache (edge); + for (i = 0; ipa_ref_list_refering_iterate (&where->ref_list, i, ref); i++) + if (ref->use == IPA_REF_ALIAS) + reset_edge_caches (ipa_ref_refering_node (ref)); if (!e) return; @@ -980,7 +985,7 @@ update_caller_keys (fibheap_t heap, struct cgraph_node *node, int i; struct ipa_ref *ref; - if (!inline_summary (node)->inlinable + if ((!node->alias && !inline_summary (node)->inlinable) || cgraph_function_body_availability (node) <= AVAIL_OVERWRITABLE || node->global.inlined_to) return; -- 2.30.2