diff options
author | Richard Guenther <rguenther@suse.de> | 2012-06-21 09:24:53 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2012-06-21 09:24:53 +0000 |
commit | ccd49f5a69406c97af0ad1acc417144fbc9ec5c5 (patch) | |
tree | cb04512cbb0cafc010dca9edcc80eff542a96157 /gcc/tree-inline.c | |
parent | 7cd7b5da2bc8a221dd9ec17bd5f6f21b0e26f11d (diff) | |
download | gcc-ccd49f5a69406c97af0ad1acc417144fbc9ec5c5.zip gcc-ccd49f5a69406c97af0ad1acc417144fbc9ec5c5.tar.gz gcc-ccd49f5a69406c97af0ad1acc417144fbc9ec5c5.tar.bz2 |
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
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r-- | gcc/tree-inline.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 9a6db40..519cde4 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -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; } |