tree-inline.c (estimate_num_insns): Estimate call cost for tailcalls properly.

2012-06-21  Richard Guenther  <rguenther@suse.de>

	* tree-inline.c (estimate_num_insns): Estimate call cost for
	tailcalls properly.

From-SVN: r188849
This commit is contained in:
Richard Guenther 2012-06-21 09:24:53 +00:00 committed by Richard Biener
parent 7cd7b5da2b
commit ccd49f5a69
2 changed files with 13 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2012-06-21 Richard Guenther <rguenther@suse.de>
* tree-inline.c (estimate_num_insns): Estimate call cost for
tailcalls properly.
2012-06-20 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
* tree.h (DECL_SOURCE_COLUMN): New accessor.

View File

@ -3611,12 +3611,15 @@ estimate_num_insns (gimple stmt, eni_weights *weights)
}
cost = node ? weights->call_cost : weights->indirect_call_cost;
if (gimple_call_lhs (stmt))
cost += estimate_move_cost (TREE_TYPE (gimple_call_lhs (stmt)));
for (i = 0; i < gimple_call_num_args (stmt); i++)
if (!gimple_call_tail_p (stmt))
{
tree arg = gimple_call_arg (stmt, i);
cost += estimate_move_cost (TREE_TYPE (arg));
if (gimple_call_lhs (stmt))
cost += estimate_move_cost (TREE_TYPE (gimple_call_lhs (stmt)));
for (i = 0; i < gimple_call_num_args (stmt); i++)
{
tree arg = gimple_call_arg (stmt, i);
cost += estimate_move_cost (TREE_TYPE (arg));
}
}
break;
}