diff options
author | Jan Hubicka <jh@suse.cz> | 2013-08-03 10:23:55 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2013-08-03 08:23:55 +0000 |
commit | 0e8853eefb91d4a81bb45eb25db4dd95dc2cf1c4 (patch) | |
tree | 6893c12531b17830080c226b0ab4329896a5a588 /gcc/tree-inline.c | |
parent | 563430f7f3c7d4c2358dd2acaf33258d7f0b0c57 (diff) | |
download | gcc-0e8853eefb91d4a81bb45eb25db4dd95dc2cf1c4.zip gcc-0e8853eefb91d4a81bb45eb25db4dd95dc2cf1c4.tar.gz gcc-0e8853eefb91d4a81bb45eb25db4dd95dc2cf1c4.tar.bz2 |
ipa-cp.c (gather_context_independent_values): Use ipa_get_param_move_cost.
* ipa-cp.c (gather_context_independent_values): Use ipa_get_param_move_cost.
(get_replacement_map): Remove PARAM; move parameter folding into tree-inline.c
(create_specialized_node): Update.
* ipa-prop.c (ipa_populate_param_decls): Do not look for origins;
assert that we have gimple body; update move_cost.
(count_formal_params): Assert that we have gimple body.
(ipa_dump_param): New function.
(ipa_alloc_node_params): Break out from ...
(ipa_initialize_node_params): ... here.
(ipa_get_vector_of_formal_parms): ICE when used in WPA.
(ipa_write_node_info): Stream move costs.
(ipa_read_node_info): Read move costs.
(ipa_update_after_lto_read): Do not recompute node params.
* ipa-prop.h (ipa_param_descriptor): Add move_cost.
(ipa_get_param): Check we are not in WPA.
(ipa_get_param_move_cost): New.
* tree-inline.c (tree_function_versioning): Fold replacement as needed.
* ipa-inline-analysis.c (inline_node_duplication_hook): Expect only
parm numbers to be present.
* gcc.dg/ipa/ipa-1.c: Update.
* gcc.dg/ipa/ipa-2.c: Update.
* gcc.dg/ipa/ipa-3.c: Update.
* gcc.dg/ipa/ipa-4.c: Update.
* gcc.dg/ipa/ipa-5.c: Update.
* gcc.dg/ipa/ipa-7.c: Update.
* gcc.dg/ipa/ipa-8.c: Update.
* gcc.dg/ipa/ipcp-1.c: Update.
* gcc.dg/ipa/ipcp-2.c: Update.
From-SVN: r201462
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r-- | gcc/tree-inline.c | 40 |
1 files changed, 33 insertions, 7 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index be3917a..2ebcd0d 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -5150,17 +5150,43 @@ tree_function_versioning (tree old_decl, tree new_decl, { int i = replace_info->parm_num; tree parm; + tree req_type; + for (parm = DECL_ARGUMENTS (old_decl); i; parm = DECL_CHAIN (parm)) i --; replace_info->old_tree = parm; + req_type = TREE_TYPE (parm); + if (!useless_type_conversion_p (req_type, TREE_TYPE (replace_info->new_tree))) + { + if (fold_convertible_p (req_type, replace_info->new_tree)) + replace_info->new_tree = fold_build1 (NOP_EXPR, req_type, replace_info->new_tree); + else if (TYPE_SIZE (req_type) == TYPE_SIZE (TREE_TYPE (replace_info->new_tree))) + replace_info->new_tree = fold_build1 (VIEW_CONVERT_EXPR, req_type, replace_info->new_tree); + else + { + if (dump_file) + { + fprintf (dump_file, " const "); + print_generic_expr (dump_file, replace_info->new_tree, 0); + fprintf (dump_file, " can't be converted to param "); + print_generic_expr (dump_file, parm, 0); + fprintf (dump_file, "\n"); + } + replace_info->old_tree = NULL; + } + } + } + else + gcc_assert (TREE_CODE (replace_info->old_tree) == PARM_DECL); + if (replace_info->old_tree) + { + init = setup_one_parameter (&id, replace_info->old_tree, + replace_info->new_tree, id.src_fn, + NULL, + &vars); + if (init) + init_stmts.safe_push (init); } - gcc_assert (TREE_CODE (replace_info->old_tree) == PARM_DECL); - init = setup_one_parameter (&id, replace_info->old_tree, - replace_info->new_tree, id.src_fn, - NULL, - &vars); - if (init) - init_stmts.safe_push (init); } } /* Copy the function's arguments. */ |