summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2011-06-13 15:34:59 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2011-06-13 15:34:59 +0000
commitf30e87e922bda64571abe28fca8edab3bdc42918 (patch)
treeb2fac6bd71eacc96cf52f96f89927df2e6cabe36
parentee5e516b99d8a88637f955412fa163b11ae33343 (diff)
downloadgcc-f30e87e922bda64571abe28fca8edab3bdc42918.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@174992 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ipa-inline-analysis.c4
-rw-r--r--gcc/ipa-inline.c7
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;