diff options
author | Jan Hubicka <jh@suse.cz> | 2005-03-28 15:16:14 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2005-03-28 13:16:14 +0000 |
commit | c7f599d0996caab1a5ba2c09cb065e053815418b (patch) | |
tree | a0b97adf5de23839438ccb88d04706c1b9efea09 /gcc | |
parent | 93f15e1e749ed086104b669e7f298146454cbef1 (diff) | |
download | gcc-c7f599d0996caab1a5ba2c09cb065e053815418b.zip gcc-c7f599d0996caab1a5ba2c09cb065e053815418b.tar.gz gcc-c7f599d0996caab1a5ba2c09cb065e053815418b.tar.bz2 |
tree-inline.c (estimate_num_insns_1): Use declaration to discover argument types where possible.
* tree-inline.c (estimate_num_insns_1): Use declaration to discover argument
types where possible.
From-SVN: r97132
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/tree-inline.c | 15 |
2 files changed, 17 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index eb471ba5..33a60b1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2005-03-28 Jan Hubicka <jh@suse.cz> + + * tree-inline.c (estimate_num_insns_1): Use declaration to discover argument + types where possible. + 2005-03-26 Per Bothner <per@bothner.com> Make -f[no-]show-column also control non-cpp diagnostics. diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 6f46eed..0b38f08 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; |