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]

[tree-ssa]: Fix PTA for memory tag changes


With this patch, C, C++, Java, Fortran, and Objective C bootstrap with PTA
turned on by default.
It does increase the runtimes of CCP and DCE slightly in large cases,
since they do more work now.

There are a few C++ files where it is a little slower than i'd like (it
takes 8% of the compile-time, which in these cases is 1 second out of 12),
but this is actually due to the overhead of calls to decl_function_context.

2003-06-01  Daniel Berlin  <dberlin@dberlin.org

	* tree-alias-common.c: Remove setting of DECL_CONTEXT in temp vars,
	it's done in create_tmp_alias_var for us.
	(ptr_may_alias_var): Check if the variables are memory tags, and get
	the associated pointers if they are.

Index: tree-alias-common.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-alias-common.c,v
retrieving revision 1.1.2.26
diff -u -3 -p -r1.1.2.26 tree-alias-common.c
--- tree-alias-common.c	19 May 2003 21:37:58 -0000	1.1.2.26
+++ tree-alias-common.c	1 Jun 2003 05:28:23 -0000
@@ -288,7 +288,6 @@ get_alias_var (expr)
 	   expression. */
 	tree temp = create_tmp_alias_var (void_type_node, "aliastmp");
 	alias_typevar tempvar;
-	DECL_CONTEXT (temp) = currptadecl;
 	tempvar = current_alias_ops->add_var (current_alias_ops,
 					      temp);
 	return tempvar;
@@ -324,7 +323,6 @@ intra_function_call (args)
 	{
 	  alias_typevar tempvar;
 	  tree temp = create_tmp_alias_var (void_type_node, "aliastmp");
-	  DECL_CONTEXT (temp) = currptadecl;
 	  tempvar = current_alias_ops->add_var (current_alias_ops, temp);
 	  /* Arguments can alias globals, and whatever they point to
 	     can point to a global as well. */
@@ -607,7 +605,6 @@ find_func_aliases (tp, walk_subtrees, da
 	      /* This becomes temp = &y and *x = temp . */
 	      alias_typevar tempvar;
 	      tree temp = create_tmp_alias_var (void_type_node, "aliastmp");
-	      DECL_CONTEXT (temp) = currptadecl;
 	      tempvar = current_alias_ops->add_var (current_alias_ops, temp);
 	      current_alias_ops->addr_assign (current_alias_ops, tempvar,
 					      rhsAV);
@@ -624,7 +621,6 @@ find_func_aliases (tp, walk_subtrees, da
 	      alias_typevar tempvar;
 	      tree temp;
 	      temp = create_tmp_alias_var (void_type_node, "aliastmp");
-	      DECL_CONTEXT (temp) = currptadecl;
 	      tempvar = current_alias_ops->add_var (current_alias_ops, temp);
 	      current_alias_ops->ptr_assign (current_alias_ops, tempvar,
 					     rhsAV);
@@ -641,7 +637,6 @@ find_func_aliases (tp, walk_subtrees, da
 	      alias_typevar tempvar;
 	      tree temp;
 	      temp = create_tmp_alias_var (void_type_node, "aliastmp");
-	      DECL_CONTEXT (temp) = currptadecl;
 	      tempvar = current_alias_ops->add_var (current_alias_ops, temp);

 	      current_alias_ops->simple_assign (current_alias_ops, tempvar,
@@ -764,7 +759,6 @@ create_fun_alias_var (decl, force)
 	{
 	  tree fakedecl = create_tmp_alias_var (TREE_VALUE (arg), "normarg");
 	  alias_typevar tvar;
-	  DECL_CONTEXT (fakedecl) = decl;
 	  tvar = get_alias_var (fakedecl);
 	  VARRAY_PUSH_GENERIC_PTR (params, tvar);

@@ -790,7 +784,6 @@ create_fun_alias_var (decl, force)
     {
       tree fakedecl = create_tmp_alias_var (void_type_node, "fakearg");
       alias_typevar fakevar;
-      DECL_CONTEXT (fakedecl) = decl;
       fakevar = get_alias_var (fakedecl);
       VARRAY_PUSH_GENERIC_PTR (params, fakevar);
     }
@@ -798,7 +791,6 @@ create_fun_alias_var (decl, force)
   if (!DECL_RESULT (decl))
     {
       rdecl = create_tmp_alias_var (TREE_TYPE (TREE_TYPE (decl)), "_rv_");
-      DECL_CONTEXT (rdecl) = decl;
       retvar = current_alias_ops->add_var (current_alias_ops, rdecl);
     }
   else
@@ -856,7 +848,6 @@ create_fun_alias_var_ptf (decl, type)
 	{
 	  tree fakedecl = create_tmp_alias_var (TREE_VALUE (arg), "ptfarg");
 	  alias_typevar tvar;
-	  DECL_CONTEXT (fakedecl) = decl;
 	  tvar = get_alias_var (fakedecl);
 	  VARRAY_PUSH_GENERIC_PTR (params, tvar);
 	}
@@ -869,13 +860,11 @@ create_fun_alias_var_ptf (decl, type)
     {
       tree fakedecl = create_tmp_alias_var (void_type_node, "fakearg");
       alias_typevar fakevar;
-      DECL_CONTEXT (fakedecl) = decl;
       fakevar = get_alias_var (fakedecl);
       VARRAY_PUSH_GENERIC_PTR (params, fakevar);
     }

   rdecl = create_tmp_alias_var (TREE_TYPE (type), "_rv_");
-  DECL_CONTEXT (rdecl) = decl;
   retvar = current_alias_ops->add_var (current_alias_ops, rdecl);
   VARRAY_PUSH_GENERIC_PTR (alias_vars, retvar);

@@ -1063,7 +1052,16 @@ ptr_may_alias_var (ptr, var)
 {
   struct alias_annot_entry entry, *result;
   alias_typevar ptrtv, vartv;
-
+  var_ann_t tempann;
+  tree ptrcontext;
+  tree varcontext;
+
+  tempann = get_var_ann (var);
+  if (tempann && tempann->is_mem_tag && tempann->mem_tag)
+    var = tempann->mem_tag;
+  tempann = get_var_ann (ptr);
+  if (tempann && tempann->is_mem_tag && tempann->mem_tag)
+    ptr = tempann->mem_tag;
 #if !FIELD_BASED
 #else
   if (TREE_CODE (ptr) == COMPONENT_REF)
@@ -1071,9 +1069,9 @@ ptr_may_alias_var (ptr, var)
   if (TREE_CODE (var) == COMPONENT_REF)
     var = TREE_OPERAND (var, 1);
 #endif
-  tree ptrcontext = DECL_CONTEXT (ptr);
-  tree varcontext = DECL_CONTEXT (var);

+  ptrcontext = DECL_CONTEXT (ptr);
+  varcontext = DECL_CONTEXT (var);
   if (ptrcontext != NULL)
     ptrcontext = decl_function_context (ptr);
   if (varcontext != NULL)


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