diff options
author | Martin Jambor <mjambor@suse.cz> | 2013-09-10 15:01:47 +0200 |
---|---|---|
committer | Martin Jambor <jamborm@gcc.gnu.org> | 2013-09-10 15:01:47 +0200 |
commit | 39e87bafc6df5d2405e7d2bedbe44018a5cd0269 (patch) | |
tree | 41e384f72fd5b14f69eb85419144267203ddbee6 /gcc | |
parent | 669ea36c4a1d0fe89905537ffc84ada23d2df3e4 (diff) | |
download | gcc-39e87bafc6df5d2405e7d2bedbe44018a5cd0269.zip gcc-39e87bafc6df5d2405e7d2bedbe44018a5cd0269.tar.gz gcc-39e87bafc6df5d2405e7d2bedbe44018a5cd0269.tar.bz2 |
ipa-cp.c (propagate_constants_topo): Do not ignore SCC represented by a thunk.
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ipa-cp.c | 39 |
2 files changed, 21 insertions, 23 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4607dd6..7a2bd31 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c index 78dee15..ce38050 100644 --- a/gcc/ipa-cp.c +++ b/gcc/ipa-cp.c @@ -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 (); } } |