summaryrefslogtreecommitdiffstats
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2005-03-28 13:16:14 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2005-03-28 13:16:14 +0000
commite064592194a7b66a6b64651b601ae08b2ac02868 (patch)
treea0b97adf5de23839438ccb88d04706c1b9efea09 /gcc/tree-inline.c
parent15b82c1f69dc894cb620c0160cd0d1eab2f5999c (diff)
downloadppe42-gcc-e064592194a7b66a6b64651b601ae08b2ac02868.tar.gz
ppe42-gcc-e064592194a7b66a6b64651b601ae08b2ac02868.zip
* tree-inline.c (estimate_num_insns_1): Use declaration to discover argument
types where possible. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@97132 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r--gcc/tree-inline.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 6f46eed8c36..0b38f08724c 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -1403,9 +1403,18 @@ estimate_num_insns_1 (tree *tp, int *walk_subtrees, void *data)
break;
}
- arg = TREE_OPERAND (x, 1);
- for (arg = TREE_OPERAND (x, 1); arg; arg = TREE_CHAIN (arg))
- *count += estimate_move_cost (TREE_TYPE (TREE_VALUE (arg)));
+ /* Our cost must be kept in sync with cgraph_estimate_size_after_inlining
+ that does use function declaration to figure out the arguments. */
+ if (!decl)
+ {
+ for (arg = TREE_OPERAND (x, 1); arg; arg = TREE_CHAIN (arg))
+ *count += estimate_move_cost (TREE_TYPE (TREE_VALUE (arg)));
+ }
+ else
+ {
+ for (arg = DECL_ARGUMENTS (decl); arg; arg = TREE_CHAIN (arg))
+ *count += estimate_move_cost (TREE_TYPE (arg));
+ }
*count += PARAM_VALUE (PARAM_INLINE_CALL_COST);
break;
OpenPOWER on IntegriCloud