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
This commit is contained in:
Jan Hubicka 2008-09-22 06:24:28 +02:00 committed by Jan Hubicka
parent d59e481e05
commit c801c273a6
2 changed files with 14 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2008-09-21 Jan Hubicka <jh@suse.cz>
* ipa-cp.c (ipcp_estimate_growth): Check recursive calls.
(ipcp_insert_stage): Update dead_nodes bitmap.
2008-09-22 Danny Smith <dannysmith@users.sourceforge.net>
PR target/37528

View File

@ -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);