]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ipa-cp.c (propagate_constants_topo): Do not ignore SCC represented by a thunk.
authorMartin Jambor <mjambor@suse.cz>
Tue, 10 Sep 2013 13:01:47 +0000 (15:01 +0200)
committerMartin Jambor <jamborm@gcc.gnu.org>
Tue, 10 Sep 2013 13:01:47 +0000 (15:01 +0200)
2013-09-10  Martin Jambor  <mjambor@suse.cz>

* ipa-cp.c (propagate_constants_topo): Do not ignore SCC
represented by a thunk.

From-SVN: r202444

gcc/ChangeLog
gcc/ipa-cp.c

index 4607dd63a68085bb5ad41c8336af95cafc2d4b61..7a2bd31a8cb69abf12b97187184191caf74a35a3 100644 (file)
@@ -1,3 +1,8 @@
+2013-09-10  Martin Jambor  <mjambor@suse.cz>
+
+       * ipa-cp.c (propagate_constants_topo): Do not ignore SCC
+       represented by a thunk.
+
 2013-09-10  Jeff Law  <law@redhat.com>
 
        PR tree-optimization/58343
index 78dee15aad8e1aefd9de6ff323d16e0ab57c324f..ce38050536192985ff0965220744851a18f86e51 100644 (file)
@@ -2113,23 +2113,17 @@ propagate_constants_topo (struct topo_info *topo)
 
   for (i = topo->nnodes - 1; i >= 0; i--)
     {
+      unsigned j;
       struct cgraph_node *v, *node = topo->order[i];
-      struct ipa_dfs_info *node_dfs_info;
+      vec<cgraph_node_ptr> cycle_nodes = ipa_get_nodes_in_cycle (node);
 
-      if (!cgraph_function_with_gimple_body_p (node))
-       continue;
-
-      node_dfs_info = (struct ipa_dfs_info *) node->symbol.aux;
       /* First, iteratively propagate within the strongly connected component
         until all lattices stabilize.  */
-      v = node_dfs_info->next_cycle;
-      while (v)
-       {
+      FOR_EACH_VEC_ELT (cycle_nodes, j, v)
+       if (cgraph_function_with_gimple_body_p (v))
          push_node_to_stack (topo, v);
-         v = ((struct ipa_dfs_info *) v->symbol.aux)->next_cycle;
-       }
 
-      v = node;
+      v = pop_node_from_stack (topo);
       while (v)
        {
          struct cgraph_edge *cs;
@@ -2144,19 +2138,18 @@ propagate_constants_topo (struct topo_info *topo)
       /* Afterwards, propagate along edges leading out of the SCC, calculates
         the local effects of the discovered constants and all valid values to
         their topological sort.  */
-      v = node;
-      while (v)
-       {
-         struct cgraph_edge *cs;
-
-         estimate_local_effects (v);
-         add_all_node_vals_to_toposort (v);
-         for (cs = v->callees; cs; cs = cs->next_callee)
-           if (!edge_within_scc (cs))
-             propagate_constants_accross_call (cs);
+      FOR_EACH_VEC_ELT (cycle_nodes, j, v)
+       if (cgraph_function_with_gimple_body_p (v))
+         {
+           struct cgraph_edge *cs;
 
-         v = ((struct ipa_dfs_info *) v->symbol.aux)->next_cycle;
-       }
+           estimate_local_effects (v);
+           add_all_node_vals_to_toposort (v);
+           for (cs = v->callees; cs; cs = cs->next_callee)
+             if (!edge_within_scc (cs))
+               propagate_constants_accross_call (cs);
+         }
+      cycle_nodes.release ();
     }
 }