diff options
author | Dehao Chen <dehao@google.com> | 2013-06-15 16:56:01 +0000 |
---|---|---|
committer | Dehao Chen <dehao@gcc.gnu.org> | 2013-06-15 16:56:01 +0000 |
commit | 4de09b857ea83e17912dad82a2dddc1047376d41 (patch) | |
tree | 0d27f935f2366cda4b8120bd06b4c6a9c25ca62d /gcc/gimple-low.c | |
parent | 58aee036e81d53cfb0c9de70369270633a042c42 (diff) | |
download | gcc-4de09b857ea83e17912dad82a2dddc1047376d41.zip gcc-4de09b857ea83e17912dad82a2dddc1047376d41.tar.gz gcc-4de09b857ea83e17912dad82a2dddc1047376d41.tar.bz2 |
tree-flow.h (gimple_check_call_matching_types): Add new argument.
2013-06-15 Dehao Chen <dehao@google.com>
* tree-flow.h (gimple_check_call_matching_types): Add new argument.
* gimple-low.c (gimple_check_call_matching_types): Likewise.
(gimple_check_call_args): Likewise.
* value-prof.c (check_ic_target): Likewise.
* ipa-inline.c (early_inliner): Likewise.
* ipa-prop.c (update_indirect_edges_after_inlining): Likewise.
* cgraph.c (cgraph_create_edge_1): Likewise.
(cgraph_make_edge_direct): Likewise.
From-SVN: r200125
Diffstat (limited to 'gcc/gimple-low.c')
-rw-r--r-- | gcc/gimple-low.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/gimple-low.c b/gcc/gimple-low.c index b06d194..64cc031 100644 --- a/gcc/gimple-low.c +++ b/gcc/gimple-low.c @@ -204,7 +204,7 @@ struct gimple_opt_pass pass_lower_cf = return false. */ static bool -gimple_check_call_args (gimple stmt, tree fndecl) +gimple_check_call_args (gimple stmt, tree fndecl, bool args_count_match) { tree parms, p; unsigned int i, nargs; @@ -243,6 +243,8 @@ gimple_check_call_args (gimple stmt, tree fndecl) && !fold_convertible_p (DECL_ARG_TYPE (p), arg))) return false; } + if (args_count_match && p) + return false; } else if (parms) { @@ -271,11 +273,13 @@ gimple_check_call_args (gimple stmt, tree fndecl) } /* Verify if the type of the argument and lhs of CALL_STMT matches - that of the function declaration CALLEE. + that of the function declaration CALLEE. If ARGS_COUNT_MATCH is + true, the arg count needs to be the same. If we cannot verify this or there is a mismatch, return false. */ bool -gimple_check_call_matching_types (gimple call_stmt, tree callee) +gimple_check_call_matching_types (gimple call_stmt, tree callee, + bool args_count_match) { tree lhs; @@ -285,7 +289,7 @@ gimple_check_call_matching_types (gimple call_stmt, tree callee) && !useless_type_conversion_p (TREE_TYPE (DECL_RESULT (callee)), TREE_TYPE (lhs)) && !fold_convertible_p (TREE_TYPE (DECL_RESULT (callee)), lhs)) - || !gimple_check_call_args (call_stmt, callee)) + || !gimple_check_call_args (call_stmt, callee, args_count_match)) return false; return true; } |