diff options
author | Jan Hubicka <jh@suse.cz> | 2008-09-22 06:24:28 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2008-09-22 04:24:28 +0000 |
commit | c801c273a6b8080f3fce824b3872fae899385618 (patch) | |
tree | db55463ff43b7c026dcc445a28880d63e8b77f03 /gcc/ipa-cp.c | |
parent | d59e481e05edcb9eecebcd278ae174e0fdf03984 (diff) | |
download | gcc-c801c273a6b8080f3fce824b3872fae899385618.tar.gz |
ipa-cp.c (ipcp_estimate_growth): Check recursive calls.
* ipa-cp.c (ipcp_estimate_growth): Check recursive calls.
(ipcp_insert_stage): Update dead_nodes bitmap.
From-SVN: r140542
Diffstat (limited to 'gcc/ipa-cp.c')
-rw-r--r-- | gcc/ipa-cp.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c index 87c724503f6..46981972f16 100644 --- a/gcc/ipa-cp.c +++ b/gcc/ipa-cp.c @@ -1051,7 +1051,7 @@ ipcp_estimate_growth (struct cgraph_node *node) int growth; for (cs = node->callers; cs != NULL; cs = cs->next_caller) - if (!ipcp_need_redirect_p (cs)) + if (cs->caller == node || !ipcp_need_redirect_p (cs)) redirectable_node_callers++; else need_original = true; @@ -1159,7 +1159,6 @@ ipcp_insert_stage (void) int i; VEC (cgraph_edge_p, heap) * redirect_callers; varray_type replace_trees; - struct cgraph_edge *cs; int node_callers, count; tree parm_tree; struct ipa_replace_map *replace_param; @@ -1209,6 +1208,7 @@ ipcp_insert_stage (void) struct ipa_node_params *info; int growth = 0; bitmap args_to_skip; + struct cgraph_edge *cs; node = (struct cgraph_node *)fibheap_extract_min (heap); node->aux = NULL; @@ -1230,6 +1230,13 @@ ipcp_insert_stage (void) new_insns += growth; + /* Look if original function becomes dead after clonning. */ + for (cs = node->callers; cs != NULL; cs = cs->next_caller) + if (cs->caller == node || ipcp_need_redirect_p (cs)) + break; + if (!cs && !node->needed) + bitmap_set_bit (dead_nodes, node->uid); + info = IPA_NODE_REF (node); count = ipa_get_param_count (info); |