ipa-inline-analysis.c (struct growth_data): Add node.
authorJan Hubicka <jh@suse.cz>
Fri, 13 Sep 2013 14:28:03 +0000 (16:28 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Fri, 13 Sep 2013 14:28:03 +0000 (14:28 +0000)
* ipa-inline-analysis.c (struct growth_data): Add node.
(do_estimate_growth_1): Fix detection of recursion.

From-SVN: r202566

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

index 672c49e92dc5927b1769dc004ecff624e9256d4b..34d39d24534c162322d3996fbe8ed0803d1b1185 100644 (file)
@@ -1,3 +1,8 @@
+2013-09-13  Jan Hubicka  <jh@suse.cz>
+
+       * ipa-inline-analysis.c (struct growth_data): Add node.
+       (do_estimate_growth_1): Fix detection of recursion.
+
 2013-09-13  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimization/58392
index 8cf8253eaca95d2d6e8603bcb251238b6f46d2bb..eaf64d35853d0c3ac9239490cc150d26fd0f9b67 100644 (file)
@@ -3580,6 +3580,7 @@ estimate_size_after_inlining (struct cgraph_node *node,
 
 struct growth_data
 {
+  struct cgraph_node *node;
   bool self_recursive;
   int growth;
 };
@@ -3597,9 +3598,9 @@ do_estimate_growth_1 (struct cgraph_node *node, void *data)
     {
       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 *node, void *data)
 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);