* ipa-inline.c (reset_edge_caches): Walk aliases.
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 13 Jun 2011 15:34:59 +0000 (15:34 +0000)
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 13 Jun 2011 15:34:59 +0000 (15:34 +0000)
(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

gcc/ipa-inline-analysis.c
gcc/ipa-inline.c

index 43e0f81..b008f05 100644 (file)
@@ -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.  */
index a2e55b9..c9328c9 100644 (file)
@@ -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;