diff options
author | Martin Jambor <mjambor@suse.cz> | 2011-08-31 19:17:19 +0200 |
---|---|---|
committer | Martin Jambor <jamborm@gcc.gnu.org> | 2011-08-31 19:17:19 +0200 |
commit | 201176d3483714110201548a37b157a33415a635 (patch) | |
tree | a322acd3f7b7a719b28233053d2eace8859ab328 /gcc/ipa-split.c | |
parent | 51093fca4c6add337ed31fe13b96d9712ab16743 (diff) | |
download | gcc-201176d3483714110201548a37b157a33415a635.zip gcc-201176d3483714110201548a37b157a33415a635.tar.gz gcc-201176d3483714110201548a37b157a33415a635.tar.bz2 |
re PR middle-end/49886 (pass_split_functions cannot deal with function type attributes)
2011-08-31 Martin Jambor <mjambor@suse.cz>
PR middle-end/49886
* ipa-inline-analysis.c (compute_inline_parameters): Set
can_change_signature of noes with typde attributes.
* ipa-split.c (split_function): Do not skip any arguments if
can_change_signature is set.
* testsuite/gcc.c-torture/execute/pr49886.c: New testcase.
From-SVN: r178386
Diffstat (limited to 'gcc/ipa-split.c')
-rw-r--r-- | gcc/ipa-split.c | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/gcc/ipa-split.c b/gcc/ipa-split.c index 7413d81..4373a1b 100644 --- a/gcc/ipa-split.c +++ b/gcc/ipa-split.c @@ -945,10 +945,10 @@ static void split_function (struct split_point *split_point) { VEC (tree, heap) *args_to_pass = NULL; - bitmap args_to_skip = BITMAP_ALLOC (NULL); + bitmap args_to_skip; tree parm; int num = 0; - struct cgraph_node *node; + struct cgraph_node *node, *cur_node = cgraph_get_node (current_function_decl); basic_block return_bb = find_return_bb (); basic_block call_bb; gimple_stmt_iterator gsi; @@ -968,17 +968,30 @@ split_function (struct split_point *split_point) dump_split_point (dump_file, split_point); } + if (cur_node->local.can_change_signature) + args_to_skip = BITMAP_ALLOC (NULL); + else + args_to_skip = NULL; + /* Collect the parameters of new function and args_to_skip bitmap. */ for (parm = DECL_ARGUMENTS (current_function_decl); parm; parm = DECL_CHAIN (parm), num++) - if (!is_gimple_reg (parm) - || !gimple_default_def (cfun, parm) - || !bitmap_bit_p (split_point->ssa_names_to_pass, - SSA_NAME_VERSION (gimple_default_def (cfun, parm)))) + if (args_to_skip + && (!is_gimple_reg (parm) + || !gimple_default_def (cfun, parm) + || !bitmap_bit_p (split_point->ssa_names_to_pass, + SSA_NAME_VERSION (gimple_default_def (cfun, + parm))))) bitmap_set_bit (args_to_skip, num); else { arg = gimple_default_def (cfun, parm); + if (!arg) + { + arg = make_ssa_name (parm, gimple_build_nop ()); + set_default_def (parm, arg); + } + if (TYPE_MAIN_VARIANT (DECL_ARG_TYPE (parm)) != TYPE_MAIN_VARIANT (TREE_TYPE (arg))) { @@ -1081,9 +1094,7 @@ split_function (struct split_point *split_point) /* Now create the actual clone. */ rebuild_cgraph_edges (); - node = cgraph_function_versioning (cgraph_get_node (current_function_decl), - NULL, NULL, - args_to_skip, + node = cgraph_function_versioning (cur_node, NULL, NULL, args_to_skip, split_point->split_bbs, split_point->entry_bb, "part"); /* For usual cloning it is enough to clear builtin only when signature @@ -1094,7 +1105,7 @@ split_function (struct split_point *split_point) DECL_BUILT_IN_CLASS (node->decl) = NOT_BUILT_IN; DECL_FUNCTION_CODE (node->decl) = (enum built_in_function) 0; } - cgraph_node_remove_callees (cgraph_get_node (current_function_decl)); + cgraph_node_remove_callees (cur_node); if (!split_part_return_p) TREE_THIS_VOLATILE (node->decl) = 1; if (dump_file) |