Hi,
this patch fixes detection of recursion in do_estimate_growth to work well with
aliases.

Bootstrapped/regtested x86_64-linux, comitted.

Honza

Index: ChangeLog
===================================================================
--- ChangeLog   (revision 202565)
+++ ChangeLog   (working copy)
@@ -1,3 +1,8 @@
+2013-09-13  Jan Hubicka  <j...@suse.cz>
+
+       * ipa-inline-analysis.c (struct growth_data): Add node.
+       (do_estimate_growth_1): Fix detection of recursion.
+
 2013-09-13  Jakub Jelinek  <ja...@redhat.com>
 
        PR tree-optimization/58392
Index: ipa-inline-analysis.c
===================================================================
--- ipa-inline-analysis.c       (revision 202565)
+++ ipa-inline-analysis.c       (working copy)
@@ -3580,6 +3580,7 @@ estimate_size_after_inlining (struct cgr
 
 struct growth_data
 {
+  struct cgraph_node *node;
   bool self_recursive;
   int growth;
 };
@@ -3597,9 +3598,9 @@ do_estimate_growth_1 (struct cgraph_node
     {
       gcc_checking_assert (e->inline_failed);
 
-      if (e->caller == node
+      if (e->caller == d->node
          || (e->caller->global.inlined_to
-             && e->caller->global.inlined_to == node))
+             && e->caller->global.inlined_to == d->node))
        d->self_recursive = true;
       d->growth += estimate_edge_growth (e);
     }
@@ -3612,7 +3613,7 @@ do_estimate_growth_1 (struct cgraph_node
 int
 do_estimate_growth (struct cgraph_node *node)
 {
-  struct growth_data d = { 0, false };
+  struct growth_data d = { node, 0, false };
   struct inline_summary *info = inline_summary (node);
 
   cgraph_for_node_and_aliases (node, do_estimate_growth_1, &d, true);

Reply via email to