From e064592194a7b66a6b64651b601ae08b2ac02868 Mon Sep 17 00:00:00 2001 From: hubicka Date: Mon, 28 Mar 2005 13:16:14 +0000 Subject: [PATCH] * 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 --- gcc/ChangeLog | 5 +++++ gcc/tree-inline.c | 15 ++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index eb471ba5190b..33a60b1b93b9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2005-03-28 Jan Hubicka + + * tree-inline.c (estimate_num_insns_1): Use declaration to discover argument + types where possible. + 2005-03-26 Per Bothner Make -f[no-]show-column also control non-cpp diagnostics. diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 6f46eed8c369..0b38f08724c6 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; -- 2.47.3