From d402c33dc1fa4ea0a9f133efdc18ae43b4b4c916 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Mon, 28 Jun 2010 02:10:34 +0200 Subject: re PR middle-end/44671 (Partial inlining breaks C++) PR middle-end/44671 PR middle-end/44686 * tree.c (build_function_decl_skip_args): Clear DECL_BUILT_IN on signature change. * ipa-split.c (split_function): Always clear DECL_BUILT_IN. * ipa-prop.c (ipa_modify_formal_parameters): Likewise. * gcc.c-torture/pr44686.c: New file. From-SVN: r161476 --- gcc/ipa-split.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'gcc/ipa-split.c') diff --git a/gcc/ipa-split.c b/gcc/ipa-split.c index 1216b0f..ccc89c4 100644 --- a/gcc/ipa-split.c +++ b/gcc/ipa-split.c @@ -277,7 +277,7 @@ consider_split (struct split_point *current, bitmap non_ssa_vars, } /* FIXME: we currently can pass only SSA function parameters to the split - arguments. Once parm_adjustment infrastructure is supported by clonning, + arguments. Once parm_adjustment infrastructure is supported by cloning, we can pass more than that. */ if (num_args != bitmap_count_bits (current->ssa_names_to_pass)) { @@ -843,6 +843,14 @@ split_function (struct split_point *split_point) args_to_skip, split_point->split_bbs, split_point->entry_bb, "_part"); + /* For usual cloning it is enough to clear builtin only when signature + changes. For partial inlining we however can not expect the part + of builtin implementation to have same semantic as the whole. */ + if (DECL_BUILT_IN (node->decl)) + { + DECL_BUILT_IN_CLASS (node->decl) = NOT_BUILT_IN; + DECL_FUNCTION_CODE (node->decl) = (enum built_in_function) 0; + } cgraph_node_remove_callees (cgraph_node (current_function_decl)); if (!split_part_return_p) TREE_THIS_VOLATILE (node->decl) = 1; -- cgit v1.1