From ca860d0367382f466936e1da3a46d6258efec822 Mon Sep 17 00:00:00 2001 From: Martin Jambor Date: Wed, 16 Apr 2014 11:20:43 +0200 Subject: [PATCH] cgraphclones.c (cgraph_create_virtual_clone): Duplicate ipa_transforms_to_apply. 2014-04-16 Martin Jambor * 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 --- gcc/ChangeLog | 10 ++++++++++ gcc/cgraphclones.c | 4 ++++ gcc/trans-mem.c | 1 + gcc/tree-inline.c | 12 ------------ 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index add19b2..404ec3f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2014-04-16 Martin Jambor + + * 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 PR target/60817 diff --git a/gcc/cgraphclones.c b/gcc/cgraphclones.c index 257939c..cd2d73d 100644 --- a/gcc/cgraphclones.c +++ b/gcc/cgraphclones.c @@ -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); diff --git a/gcc/trans-mem.c b/gcc/trans-mem.c index fe6dc28..87a8fd9 100644 --- a/gcc/trans-mem.c +++ b/gcc/trans-mem.c @@ -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; diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index dea8521..a0832b4 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -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 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 -- 2.7.4