This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] tree-ssa-alias.c: Remove add_type_alias.


Hi,

Attached is a patch to remove add_type_alias as it is unused.

Tested on x86_64-pc-linux-gnu.  OK to apply?

Kazu Hirata

2006-05-29  Kazu Hirata  <kazu@codesourcery.com>

	* tree-flow.h: Remove the prototype for add_type_alias.
	* tree-ssa-alias.c (add_type_alias): Remove.

Index: tree-flow.h
===================================================================
--- tree-flow.h	(revision 114181)
+++ tree-flow.h	(working copy)
@@ -667,7 +667,6 @@ extern void debug_points_to_info_for (tr
 extern bool may_be_aliased (tree);
 extern bool is_aliased_with (tree, tree);
 extern struct ptr_info_def *get_ptr_info (tree);
-extern void add_type_alias (tree, tree);
 extern void new_type_alias (tree, tree);
 extern void count_uses_and_derefs (tree, tree, unsigned *, unsigned *, bool *);
 static inline subvar_t get_subvars_for_var (tree);
Index: tree-ssa-alias.c
===================================================================
--- tree-ssa-alias.c	(revision 114181)
+++ tree-ssa-alias.c	(working copy)
@@ -2687,93 +2687,6 @@ is_aliased_with (tree tag, tree sym)
 }
 
 
-/* Add VAR to the list of may-aliases of PTR's symbol tag.  If PTR
-   doesn't already have a symbol tag, create one.  */
-
-void
-add_type_alias (tree ptr, tree var)
-{
-  VEC(tree, gc) *aliases;
-  tree tag, al;
-  var_ann_t ann = var_ann (ptr);
-  subvar_t svars;
-  VEC (tree, heap) *varvec = NULL;  
-  unsigned i;
-
-  if (ann->symbol_mem_tag == NULL_TREE)
-    {
-      tree q = NULL_TREE;
-      tree tag_type = TREE_TYPE (TREE_TYPE (ptr));
-      HOST_WIDE_INT tag_set = get_alias_set (tag_type);
-      safe_referenced_var_iterator rvi;
-
-      /* PTR doesn't have a symbol tag, create a new one and add VAR to
-	 the new tag's alias set.
-
-	 FIXME, This is slower than necessary.  We need to determine
-	 whether there is another pointer Q with the same alias set as
-	 PTR.  This could be sped up by having symbol tags associated
-	 with types.  */
-      FOR_EACH_REFERENCED_VAR_SAFE (q, varvec, rvi)
-	{
-	  if (POINTER_TYPE_P (TREE_TYPE (q))
-	      && tag_set == get_alias_set (TREE_TYPE (TREE_TYPE (q))))
-	    {
-	      /* Found another pointer Q with the same alias set as
-		 the PTR's pointed-to type.  If Q has a symbol tag, use
-		 it.  Otherwise, create a new memory tag for PTR.  */
-	      var_ann_t ann1 = var_ann (q);
-	      if (ann1->symbol_mem_tag)
-		ann->symbol_mem_tag = ann1->symbol_mem_tag;
-	      else
-		ann->symbol_mem_tag = create_memory_tag (tag_type, true);
-	      goto found_tag;
-	    }
-	}
-
-      /* Couldn't find any other pointer with a symbol tag we could use.
-	 Create a new memory tag for PTR.  */
-      ann->symbol_mem_tag = create_memory_tag (tag_type, true);
-    }
-
-found_tag:
-  /* If VAR is not already PTR's symbol tag, add it to the may-alias set
-     for PTR's symbol tag.  */
-  gcc_assert (!MTAG_P (var));
-  tag = ann->symbol_mem_tag;
-
-  /* If VAR has subvars, add the subvars to the tag instead of the
-     actual var.  */
-  if (var_can_have_subvars (var)
-      && (svars = get_subvars_for_var (var)))
-    {
-      subvar_t sv;      
-      for (sv = svars; sv; sv = sv->next)
-	add_may_alias (tag, sv->var);
-    }
-  else
-    add_may_alias (tag, var);
-
-  /* TAG and its set of aliases need to be marked for renaming.  */
-  mark_sym_for_renaming (tag);
-  if ((aliases = var_ann (tag)->may_aliases) != NULL)
-    {
-      for (i = 0; VEC_iterate (tree, aliases, i, al); i++)
-	mark_sym_for_renaming (al);
-    }
-
-  /* If we had grouped aliases, VAR may have aliases of its own.  Mark
-     them for renaming as well.  Other statements referencing the
-     aliases of VAR will need to be updated.  */
-  if ((aliases = var_ann (var)->may_aliases) != NULL)
-    {
-      for (i = 0; VEC_iterate (tree, aliases, i, al); i++)
-	mark_sym_for_renaming (al);
-    }
-  VEC_free (tree, heap, varvec);
-}
-
-
 /* Create a new symbol tag for PTR.  Construct the may-alias list of this type
    tag so that it has the aliasing of VAR. 
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]