diff mbox

Avoid creation of bogus type variant in cgraphclones.c

Message ID 20141002045205.GA30713@kam.mff.cuni.cz
State New
Headers show

Commit Message

Jan Hubicka Oct. 2, 2014, 4:52 a.m. UTC
Hi,
this patch avoids creation of bogus type variant i ncgraphclones.c.
This is same as my earlier patch to ipa-prop

Bootstrapped/regtested x86_64-linux.
Honza
	* cgraphclones.c (build_function_type_skip_args): Do not
	add new type as variant.
diff mbox

Patch

Index: cgraphclones.c
===================================================================
--- cgraphclones.c	(revision 215658)
+++ cgraphclones.c	(working copy)
@@ -177,7 +177,7 @@  build_function_type_skip_args (tree orig
 			       bool skip_return)
 {
   tree new_type = NULL;
-  tree args, new_args = NULL, t;
+  tree args, new_args = NULL;
   tree new_reversed;
   int i = 0;
 
@@ -218,22 +218,6 @@  build_function_type_skip_args (tree orig
   if (skip_return)
     TREE_TYPE (new_type) = void_type_node;
 
-  /* This is a new type, not a copy of an old type.  Need to reassociate
-     variants.  We can handle everything except the main variant lazily.  */
-  t = TYPE_MAIN_VARIANT (orig_type);
-  if (t != orig_type)
-    {
-      t = build_function_type_skip_args (t, args_to_skip, skip_return);
-      TYPE_MAIN_VARIANT (new_type) = t;
-      TYPE_NEXT_VARIANT (new_type) = TYPE_NEXT_VARIANT (t);
-      TYPE_NEXT_VARIANT (t) = new_type;
-    }
-  else
-    {
-      TYPE_MAIN_VARIANT (new_type) = new_type;
-      TYPE_NEXT_VARIANT (new_type) = NULL;
-    }
-
   return new_type;
 }