cgraphclones.c (cgraph_create_virtual_clone): Duplicate ipa_transforms_to_apply.

2014-04-16  Martin Jambor  <mjambor@suse.cz>

	* cgraphclones.c (cgraph_create_virtual_clone): Duplicate
	ipa_transforms_to_apply.
	(cgraph_function_versioning): Assert that old_node has empty
	ipa_transforms_to_apply.
	* trans-mem.c (ipa_tm_create_version): Likewise.
	* tree-inline.c (tree_function_versioning): Do not duplicate
	ipa_transforms_to_apply.

From-SVN: r209441
This commit is contained in:
Martin Jambor 2014-04-16 11:20:43 +02:00 committed by Martin Jambor
parent fe4e71e4d7
commit ca860d0367
4 changed files with 15 additions and 12 deletions

View File

@ -1,3 +1,13 @@
2014-04-16 Martin Jambor <mjambor@suse.cz>
* cgraphclones.c (cgraph_create_virtual_clone): Duplicate
ipa_transforms_to_apply.
(cgraph_function_versioning): Assert that old_node has empty
ipa_transforms_to_apply.
* trans-mem.c (ipa_tm_create_version): Likewise.
* tree-inline.c (tree_function_versioning): Do not duplicate
ipa_transforms_to_apply.
2014-04-16 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
PR target/60817

View File

@ -600,6 +600,9 @@ cgraph_create_virtual_clone (struct cgraph_node *old_node,
}
else
new_node->clone.combined_args_to_skip = args_to_skip;
if (old_node->ipa_transforms_to_apply.exists ())
new_node->ipa_transforms_to_apply
= old_node->ipa_transforms_to_apply.copy ();
cgraph_call_node_duplication_hooks (old_node, new_node);
@ -971,6 +974,7 @@ cgraph_function_versioning (struct cgraph_node *old_version_node,
cgraph_copy_node_for_versioning (old_version_node, new_decl,
redirect_callers, bbs_to_copy);
gcc_assert (!old_version_node->ipa_transforms_to_apply.exists ());
/* Copy the OLD_VERSION_NODE function tree to the new version. */
tree_function_versioning (old_decl, new_decl, tree_map, false, args_to_skip,
skip_return, bbs_to_copy, new_entry_block);

View File

@ -4914,6 +4914,7 @@ ipa_tm_create_version (struct cgraph_node *old_node)
if (DECL_ONE_ONLY (new_decl))
DECL_COMDAT_GROUP (new_decl) = tm_mangle (DECL_COMDAT_GROUP (old_decl));
gcc_assert (!old_node->ipa_transforms_to_apply.exists ());
new_node = cgraph_copy_node_for_versioning (old_node, new_decl, vNULL, NULL);
new_node->local.local = false;
new_node->externally_visible = old_node->externally_visible;

View File

@ -5324,18 +5324,6 @@ tree_function_versioning (tree old_decl, tree new_decl,
id.dst_node = new_version_node;
id.src_cfun = DECL_STRUCT_FUNCTION (old_decl);
id.blocks_to_copy = blocks_to_copy;
if (id.src_node->ipa_transforms_to_apply.exists ())
{
vec<ipa_opt_pass> old_transforms_to_apply
= id.dst_node->ipa_transforms_to_apply;
unsigned int i;
id.dst_node->ipa_transforms_to_apply
= id.src_node->ipa_transforms_to_apply.copy ();
for (i = 0; i < old_transforms_to_apply.length (); i++)
id.dst_node->ipa_transforms_to_apply.safe_push (old_transforms_to_apply[i]);
old_transforms_to_apply.release ();
}
id.copy_decl = copy_decl_no_change;
id.transform_call_graph_edges