cgraphclones.c (cgraph_create_virtual_clone): Duplicate ipa_transforms_to_apply.
authorMartin Jambor <mjambor@suse.cz>
Wed, 16 Apr 2014 09:20:43 +0000 (11:20 +0200)
committerMartin Jambor <jamborm@gcc.gnu.org>
Wed, 16 Apr 2014 09:20:43 +0000 (11:20 +0200)
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

gcc/ChangeLog
gcc/cgraphclones.c
gcc/trans-mem.c
gcc/tree-inline.c

index add19b2..404ec3f 100644 (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
index 257939c..cd2d73d 100644 (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);
index fe6dc28..87a8fd9 100644 (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;
index dea8521..a0832b4 100644 (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