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]

[improved-aliasing]: Move function info to function_ann and addescape mask


This moves the function specific pieces of var_ann to a new
function_ann, and also adds an escape mask to the annotation that tells
the reason for a variable escaping the function (So it's still a net
memory reduction).


This will be used to post-process the call clobbered vars and remove
those that couldn't really be clobbered by certain functions (at least,
until interprocedural PTA/call clobbering is done).

Bootstrapped and regtested on i686-pc-linux-gnu.

Applied to improved aliasing.
--Dan
2005-09-26  Daniel Berlin  <dberlin@dberlin.org>
	   
	* ipa-callees.c (callees_execute): Use function_ann.
	* ipa-reference.c (get_reference_vars_info_from_cgraph): Ditto.
	(get_local_reference_vars_info): Ditto.
	(get_global_reference_vars_info): Ditto.
	(analyze_function): Ditto.
	(clean_function): Ditto.
	* tree-dfa.c (create_function_ann): New function.
	* tree-flow-inline.h (var_ann): FUNCTION_DECL's don't have
	var_ann.
	(function_ann): New.
	(get_function_ann): Ditto.
	(mark_call_clobbered): Add escape_type parameter.
	Set escape mask.
	(mark_bitmap_call_clobbered): Removed for now.
	(clear_call_clobbered): Clear escape_mask.
	* tree-flow.h (tree_ann_type): Add FUNCTION_ANN.
	(struct var_ann_d): Add escape_mask.
	Move callees and reference_vars_info to function annotation.
	(struct function_ann_d): New.
	(union tree_ann_d): Add function_ann.
	(enum escape_type): New.
	* tree-outof-ssa.c (create_temp): Copy escape_mask.
	* tree-ssa-alias.c (mark_aliases_call_clobbered): Use escape mask.
	(compute_tag_properties): Ditto.
	(set_initial_properties): Ditto.
	(compute_call_clobbered): Ditto.
	(is_escape_site): Return escape type.
	(create_global_var): Mark as escaped.
	* tree-ssa-structalias.c (update_alias_info): Mark reason for
	escaping. 
	
Index: ipa-callees.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/ipa-callees.c,v
retrieving revision 1.1.2.1
diff -u -p -r1.1.2.1 ipa-callees.c
--- ipa-callees.c	22 Sep 2005 19:20:53 -0000	1.1.2.1
+++ ipa-callees.c	26 Sep 2005 20:57:09 -0000
@@ -87,12 +87,12 @@ callees_execute (void)
       {
 	tree decl = node->decl;
 	enum availability avail = cgraph_function_body_availability (node);
-	var_ann_t ann;
+	function_ann_t ann;
 	struct cgraph_edge *e;
 
 	if (TREE_ADDRESSABLE (decl) || avail == AVAIL_NOT_AVAILABLE)
 	  bitmap_set_bit (global_and_address_taken, node->uid);
-	ann = get_var_ann (decl);
+	ann = get_function_ann (decl);
 	ann->callees = BITMAP_ALLOC (&callee_obstack);
 	for (e = node->callees; e; e = e->next_callee)
 	  {
@@ -116,16 +116,16 @@ callees_execute (void)
 	  for (e = node->callees; e; e = e->next_callee)
 	    {
 	      struct cgraph_node *cnode = e->callee;
-	      var_ann_t ann;
+	      function_ann_t ann;
 	      if (!cnode->analyzed)
 		continue;
-	      ann = var_ann (node->decl);
+	      ann = function_ann (node->decl);
 
 	      if (cgraph_function_body_availability (cnode) == AVAIL_NOT_AVAILABLE)
 		changed |= bitmap_ior_into (ann->callees,
 					    global_and_address_taken);
 	      changed |= bitmap_ior_into (ann->callees,
-					  var_ann (cnode->decl)->callees);
+					  function_ann (cnode->decl)->callees);
 
 	    }
 	}
Index: ipa-reference.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ipa-reference.c,v
retrieving revision 2.3.8.2
diff -u -p -r2.3.8.2 ipa-reference.c
--- ipa-reference.c	22 Sep 2005 19:20:53 -0000	2.3.8.2
+++ ipa-reference.c	26 Sep 2005 20:57:09 -0000
@@ -111,7 +111,7 @@ tree memory_identifier_string;
 static inline ipa_reference_vars_info_t
 get_reference_vars_info_from_cgraph (struct cgraph_node * node)
 {
-  return get_var_ann (node->decl)->reference_vars_info;
+  return get_function_ann (node->decl)->reference_vars_info;
 }
 
 /* Get a bitmap that contains all of the locally referenced static
@@ -119,7 +119,7 @@ get_reference_vars_info_from_cgraph (str
 static ipa_reference_local_vars_info_t
 get_local_reference_vars_info (tree fn) 
 {
-  ipa_reference_vars_info_t info = get_var_ann (fn)->reference_vars_info;
+  ipa_reference_vars_info_t info = get_function_ann (fn)->reference_vars_info;
 
   if (info)
     return info->local;
@@ -134,7 +134,7 @@ get_local_reference_vars_info (tree fn) 
 static ipa_reference_global_vars_info_t
 get_global_reference_vars_info (tree fn) 
 {
-  ipa_reference_vars_info_t info = get_var_ann (fn)->reference_vars_info;
+  ipa_reference_vars_info_t info = get_function_ann (fn)->reference_vars_info;
 
   if (info)
     return info->global;
@@ -794,7 +794,7 @@ analyze_function (struct cgraph_node *fn
   tree decl = fn->decl;
 
   /* Add the info to the tree's annotation.  */
-  get_var_ann (fn->decl)->reference_vars_info = info;
+  get_function_ann (fn->decl)->reference_vars_info = info;
 
   info->local = l;
   l->statics_read = BITMAP_ALLOC (&ipa_obstack);
@@ -878,8 +878,8 @@ clean_function (struct cgraph_node *fn)
     }
 
   
-  free (get_var_ann (fn->decl)->reference_vars_info);
-  get_var_ann (fn->decl)->reference_vars_info = NULL;
+  free (get_function_ann (fn->decl)->reference_vars_info);
+  get_function_ann (fn->decl)->reference_vars_info = NULL;
 }
 
 
Index: tree-dfa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-dfa.c,v
retrieving revision 2.63.4.4
diff -u -p -r2.63.4.4 tree-dfa.c
--- tree-dfa.c	26 Sep 2005 17:05:45 -0000	2.63.4.4
+++ tree-dfa.c	26 Sep 2005 20:57:09 -0000
@@ -161,6 +161,26 @@ create_var_ann (tree t)
   return ann;
 }
 
+/* Create a new annotation for a FUNCTION_DECL node T.  */
+
+function_ann_t
+create_function_ann (tree t)
+{
+  function_ann_t ann;
+
+  gcc_assert (t);
+  gcc_assert (TREE_CODE (t) == FUNCTION_DECL);
+  gcc_assert (!t->common.ann || t->common.ann->common.type == FUNCTION_ANN);
+
+  ann = ggc_alloc (sizeof (*ann));
+  memset ((void *) ann, 0, sizeof (*ann));
+
+  ann->common.type = FUNCTION_ANN;
+
+  t->common.ann = (tree_ann_t) ann;
+
+  return ann;
+}
 
 /* Create a new annotation for a statement node T.  */
 
Index: tree-flow-inline.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-flow-inline.h,v
retrieving revision 2.56.2.4
diff -u -p -r2.56.2.4 tree-flow-inline.h
--- tree-flow-inline.h	26 Sep 2005 17:05:46 -0000	2.56.2.4
+++ tree-flow-inline.h	26 Sep 2005 20:57:09 -0000
@@ -125,6 +125,7 @@ var_ann (tree t)
 {
   gcc_assert (t);
   gcc_assert (DECL_P (t));
+  gcc_assert (TREE_CODE (t) != FUNCTION_DECL);
   gcc_assert (!t->common.ann || t->common.ann->common.type == VAR_ANN);
 
   return (var_ann_t) t->common.ann;
@@ -139,6 +140,27 @@ get_var_ann (tree var)
   return (ann) ? ann : create_var_ann (var);
 }
 
+/* Return the function annotation for T, which must be a FUNCTION_DECL node.
+   Return NULL if the function annotation doesn't already exist.  */
+static inline function_ann_t
+function_ann (tree t)
+{
+  gcc_assert (t);
+  gcc_assert (TREE_CODE (t) == FUNCTION_DECL);
+  gcc_assert (!t->common.ann || t->common.ann->common.type == FUNCTION_ANN);
+
+  return (function_ann_t) t->common.ann;
+}
+
+/* Return the function annotation for T, which must be a FUNCTION_DECL node.
+   Create the function annotation if it doesn't exist.  */
+static inline function_ann_t
+get_function_ann (tree var)
+{
+  function_ann_t ann = function_ann (var);
+  return (ann) ? ann : create_function_ann (var);
+}
+
 /* Return the statement annotation for T, which must be a statement
    node.  Return NULL if the statement annotation doesn't exist.  */
 static inline stmt_ann_t
@@ -849,27 +871,20 @@ is_call_clobbered (tree var)
 
 /* Mark variable VAR as being clobbered by function calls.  */
 static inline void
-mark_call_clobbered (tree var)
+mark_call_clobbered (tree var, unsigned int escape_type)
 {
+  var_ann (var)->escape_mask |= escape_type;
   bitmap_set_bit (call_clobbered_vars, DECL_UID (var));
   ssa_call_clobbered_cache_valid = false;
   ssa_ro_call_cache_valid = false;
 }
-
-/* Mark the variables in IDS (which is a set of DECL_UIDs), as being
-   clobbered by function calls.   */
-static inline void
-mark_bitmap_call_clobbered (bitmap ids)
-{
-  bitmap_ior_into (call_clobbered_vars, ids);
-  ssa_call_clobbered_cache_valid = false;
-  ssa_ro_call_cache_valid = false;
-}
   
 /* Clear the call-clobbered attribute from variable VAR.  */
 static inline void
 clear_call_clobbered (tree var)
 {
+  var_ann_t ann = var_ann (var);
+  ann->escape_mask = 0;
   if (TREE_CODE (var) != STRUCT_FIELD_TAG && MTAG_P (var))
     MTAG_GLOBAL (var) = 0;
   bitmap_clear_bit (call_clobbered_vars, DECL_UID (var));
Index: tree-flow.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-flow.h,v
retrieving revision 2.132.2.4
diff -u -p -r2.132.2.4 tree-flow.h
--- tree-flow.h	26 Sep 2005 17:05:46 -0000	2.132.2.4
+++ tree-flow.h	26 Sep 2005 20:57:10 -0000
@@ -98,7 +98,7 @@ struct ptr_info_def GTY(())
 /*---------------------------------------------------------------------------
 		   Tree annotations stored in tree_common.ann
 ---------------------------------------------------------------------------*/
-enum tree_ann_type { TREE_ANN_COMMON, VAR_ANN, STMT_ANN };
+enum tree_ann_type { TREE_ANN_COMMON, VAR_ANN, FUNCTION_ANN, STMT_ANN };
 
 struct tree_ann_common_d GTY(())
 {
@@ -215,19 +215,28 @@ struct var_ann_d GTY(())
      current version of this variable (an SSA_NAME).  */
   tree current_def;
   
+
+  /* If this variable is a structure, this fields holds a list of
+     symbols representing each of the fields of the structure.  */
+  subvar_t subvars;
+
+  /* Mask of values saying the reasons why this variable has escaped
+     the function.  */
+  unsigned int escape_mask;
+};
+
+struct function_ann_d GTY(())
+{
+  struct tree_ann_common_d common;
+
   /* Pointer to the structure that contains the sets of global
      variables modified by function calls.  This field is only used
      for FUNCTION_DECLs.  */
   ipa_reference_vars_info_t GTY ((skip)) reference_vars_info;
   
   bitmap GTY((skip)) callees;
-
-  /* If this variable is a structure, this fields holds a list of
-     symbols representing each of the fields of the structure.  */
-  subvar_t subvars;
 };
 
-
 typedef struct immediate_use_iterator_d
 {
   ssa_use_operand_t *imm_use;
@@ -301,7 +310,8 @@ struct stmt_ann_d GTY(())
 union tree_ann_d GTY((desc ("ann_type ((tree_ann_t)&%h)")))
 {
   struct tree_ann_common_d GTY((tag ("TREE_ANN_COMMON"))) common;
-  struct var_ann_d GTY((tag ("VAR_ANN"))) decl;
+  struct var_ann_d GTY((tag ("VAR_ANN"))) vdecl;
+  struct function_ann_d GTY((tag ("FUNCTION_ANN"))) fdecl;
   struct stmt_ann_d GTY((tag ("STMT_ANN"))) stmt;
 };
 
@@ -309,12 +319,15 @@ extern GTY(()) VEC(tree,gc) *modified_no
 
 typedef union tree_ann_d *tree_ann_t;
 typedef struct var_ann_d *var_ann_t;
+typedef struct function_ann_d *function_ann_t;
 typedef struct stmt_ann_d *stmt_ann_t;
 
 static inline tree_ann_t tree_ann (tree);
 static inline tree_ann_t get_tree_ann (tree);
 static inline var_ann_t var_ann (tree);
 static inline var_ann_t get_var_ann (tree);
+static inline function_ann_t function_ann (tree);
+static inline function_ann_t get_function_ann (tree);
 static inline stmt_ann_t stmt_ann (tree);
 static inline stmt_ann_t get_stmt_ann (tree);
 static inline enum tree_ann_type ann_type (tree_ann_t);
@@ -546,6 +559,7 @@ extern void dump_generic_bb (FILE *, bas
 
 /* In tree-dfa.c  */
 extern var_ann_t create_var_ann (tree);
+extern function_ann_t create_function_ann (tree);
 extern stmt_ann_t create_stmt_ann (tree);
 extern tree_ann_t create_tree_ann (tree);
 extern void reserve_phi_args_for_new_edge (basic_block);
@@ -746,10 +760,22 @@ enum move_pos
   };
 extern enum move_pos movement_possibility (tree);
 
+enum escape_type 
+  {
+    NO_ESCAPE = 0,
+    ESCAPE_STORED_IN_GLOBAL = 1 << 1,    
+    ESCAPE_TO_ASM = 1 << 2,
+    ESCAPE_TO_CALL = 1 << 3,
+    ESCAPE_BAD_CAST = 1 << 4, 
+    ESCAPE_TO_RETURN = 1 << 5,
+    ESCAPE_TRANSITIVE = 1 << 6,
+    ESCAPE_IS_GLOBAL = 1 << 7,
+    ESCAPE_UNKNOWN = 1 << 8
+  };
+
 /* In tree-flow-inline.h  */
 static inline bool is_call_clobbered (tree);
-static inline void mark_call_clobbered (tree);
-static inline void mark_bitmap_call_clobbered (bitmap);
+static inline void mark_call_clobbered (tree, unsigned int);
 static inline void set_is_used (tree);
 static inline bool unmodifiable_var_p (tree);
 
Index: tree-outof-ssa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-outof-ssa.c,v
retrieving revision 2.66
diff -u -p -r2.66 tree-outof-ssa.c
--- tree-outof-ssa.c	4 Aug 2005 23:36:59 -0000	2.66
+++ tree-outof-ssa.c	26 Sep 2005 20:57:10 -0000
@@ -177,7 +177,7 @@ create_temp (tree t)
      inherit from our original variable.  */
   var_ann (tmp)->type_mem_tag = var_ann (t)->type_mem_tag;
   if (is_call_clobbered (t))
-    mark_call_clobbered (tmp);
+    mark_call_clobbered (tmp, var_ann (t)->escape_mask);
 
   return tmp;
 }
Index: tree-ssa-alias.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-alias.c,v
retrieving revision 2.109.4.8
diff -u -p -r2.109.4.8 tree-ssa-alias.c
--- tree-ssa-alias.c	26 Sep 2005 17:05:47 -0000	2.109.4.8
+++ tree-ssa-alias.c	26 Sep 2005 20:57:11 -0000
@@ -196,6 +196,7 @@ mark_aliases_call_clobbered (tree tag, V
 {
   unsigned int i;
   varray_type ma;
+  var_ann_t ta = var_ann (tag);
 
   if (!MTAG_P (tag))
     return;
@@ -208,7 +209,7 @@ mark_aliases_call_clobbered (tree tag, V
       if (!unmodifiable_var_p (entry))
 	{
 	  add_to_worklist (entry, worklist);	  
-	  mark_call_clobbered (entry);
+	  mark_call_clobbered (entry, ta->escape_mask);
 	}
     }
 }
@@ -277,7 +278,7 @@ compute_tag_properties (void)
 		 call clobbered.  */
 	      if (is_call_clobbered (entry) && !is_call_clobbered (tag))
 		{		  
-		  mark_call_clobbered (tag);
+		  mark_call_clobbered (tag, var_ann (entry)->escape_mask);
 		  changed = true;
 		}
 
@@ -309,7 +310,7 @@ set_initial_properties (struct alias_inf
     {
       if (is_global_var (var) && !var_can_have_subvars (var))
 	if (!unmodifiable_var_p (var))
-	  mark_call_clobbered (var);
+	  mark_call_clobbered (var, ESCAPE_IS_GLOBAL);
     }
 
   for (i = 0; i < VARRAY_ACTIVE_SIZE (ai->processed_ptrs); i++)
@@ -323,10 +324,10 @@ set_initial_properties (struct alias_inf
 	  /* If PTR escapes or may point to anything, then its associated
 	     memory tags and pointed-to variables are call-clobbered.  */
 	  if (pi->name_mem_tag)
-	    mark_call_clobbered (pi->name_mem_tag);
+	    mark_call_clobbered (pi->name_mem_tag, v_ann->escape_mask);
 
 	  if (v_ann->type_mem_tag)
-	    mark_call_clobbered (v_ann->type_mem_tag);
+	    mark_call_clobbered (v_ann->type_mem_tag, v_ann->escape_mask);
 
 	  if (pi->pt_vars)
 	    {
@@ -334,7 +335,7 @@ set_initial_properties (struct alias_inf
 	      unsigned int j;	      
 	      EXECUTE_IF_SET_IN_BITMAP (pi->pt_vars, 0, j, bi)
 		if (!unmodifiable_var_p (referenced_var (j)))
-		  mark_call_clobbered (referenced_var (j));
+		  mark_call_clobbered (referenced_var (j), v_ann->escape_mask);
 	    }
 	}
       /* If the name tag is call clobbered, so is the type tag
@@ -342,7 +343,7 @@ set_initial_properties (struct alias_inf
       if (pi->name_mem_tag
 	  && v_ann->type_mem_tag
 	  && is_call_clobbered (pi->name_mem_tag))
-	mark_call_clobbered (v_ann->type_mem_tag);
+	mark_call_clobbered (v_ann->type_mem_tag, v_ann->escape_mask);
 
       if ((pi->pt_global_mem || pi->pt_anything) && pi->name_mem_tag)
 	mark_MTAG_GLOBAL (pi->name_mem_tag);
@@ -364,7 +365,7 @@ compute_call_clobbered (struct alias_inf
   while (VEC_length (tree, worklist) != 0)
     {
       tree curr = VEC_pop (tree, worklist);
-      mark_call_clobbered (curr);
+      mark_call_clobbered (curr, ESCAPE_TRANSITIVE);
       mark_aliases_call_clobbered (curr, &worklist);
     }
   VEC_free (tree, heap, worklist);
@@ -1870,7 +1871,7 @@ set_pt_anything (tree ptr)
 
    AI points to the alias information collected so far.  */
 
-bool
+enum escape_type
 is_escape_site (tree stmt, struct alias_info *ai)
 {
   tree call = get_call_expr_in (stmt);
@@ -1881,10 +1882,10 @@ is_escape_site (tree stmt, struct alias_
       if (!TREE_SIDE_EFFECTS (call))
 	ai->num_pure_const_calls_found++;
 
-      return true;
+      return ESCAPE_TO_CALL;
     }
   else if (TREE_CODE (stmt) == ASM_EXPR)
-    return true;
+    return ESCAPE_TO_ASM;
   else if (TREE_CODE (stmt) == MODIFY_EXPR)
     {
       tree lhs = TREE_OPERAND (stmt, 0);
@@ -1896,7 +1897,7 @@ is_escape_site (tree stmt, struct alias_
       /* If we couldn't recognize the LHS of the assignment, assume that it
 	 is a non-local store.  */
       if (lhs == NULL_TREE)
-	return true;
+	return ESCAPE_UNKNOWN;
 
       /* If the RHS is a conversion between a pointer and an integer, the
 	 pointer escapes since we can't track the integer.  */
@@ -1906,12 +1907,12 @@ is_escape_site (tree stmt, struct alias_
 	  && POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND
 					(TREE_OPERAND (stmt, 1), 0)))
 	  && !POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (stmt, 1))))
-	return true;
+	return ESCAPE_BAD_CAST;
 
       /* If the LHS is an SSA name, it can't possibly represent a non-local
 	 memory store.  */
       if (TREE_CODE (lhs) == SSA_NAME)
-	return false;
+	return NO_ESCAPE;
 
       /* FIXME: LHS is not an SSA_NAME.  Even if it's an assignment to a
 	 local variables we cannot be sure if it will escape, because we
@@ -1922,12 +1923,12 @@ is_escape_site (tree stmt, struct alias_
 	 Midkiff, ``Escape analysis for java,'' in Proceedings of the
 	 Conference on Object-Oriented Programming Systems, Languages, and
 	 Applications (OOPSLA), pp. 1-19, 1999.  */
-      return true;
+      return ESCAPE_STORED_IN_GLOBAL;
     }
   else if (TREE_CODE (stmt) == RETURN_EXPR)
-    return true;
+    return ESCAPE_TO_RETURN;
 
-  return false;
+  return NO_ESCAPE;
 }
 
 
@@ -2094,7 +2095,8 @@ create_global_var (void)
   DECL_CONTEXT (global_var) = NULL_TREE;
   TREE_THIS_VOLATILE (global_var) = 0;
   TREE_ADDRESSABLE (global_var) = 0;
-  mark_call_clobbered (global_var);
+  create_var_ann (global_var);
+  mark_call_clobbered (global_var, ESCAPE_UNKNOWN);
   add_referenced_tmp_var (global_var);
   mark_sym_for_renaming (global_var);
 }
Index: tree-ssa-structalias.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-structalias.c,v
retrieving revision 2.27.2.3
diff -u -p -r2.27.2.3 tree-ssa-structalias.c
--- tree-ssa-structalias.c	22 Sep 2005 19:20:58 -0000	2.27.2.3
+++ tree-ssa-structalias.c	26 Sep 2005 20:57:12 -0000
@@ -2540,7 +2540,7 @@ update_alias_info (tree stmt, struct ali
   bitmap addr_taken;
   use_operand_p use_p;
   ssa_op_iter iter;
-  bool stmt_escapes_p = is_escape_site (stmt, ai);
+  enum escape_type stmt_escape_type = is_escape_site (stmt, ai);
   tree op;
 
   /* Mark all the variables whose address are taken by the statement.  */
@@ -2551,16 +2551,16 @@ update_alias_info (tree stmt, struct ali
 
       /* If STMT is an escape point, all the addresses taken by it are
 	 call-clobbered.  */
-      if (stmt_escapes_p)
+      if (stmt_escape_type != NO_ESCAPE)
 	{
 	  bitmap_iterator bi;
 	  unsigned i;
-
+	  
 	  EXECUTE_IF_SET_IN_BITMAP (addr_taken, 0, i, bi)
 	    {
 	      tree rvar = referenced_var (i);
 	      if (!unmodifiable_var_p (rvar))
-		mark_call_clobbered (rvar);
+		mark_call_clobbered (rvar, stmt_escape_type);
 	    }
 	}
     }
@@ -2687,13 +2687,14 @@ update_alias_info (tree stmt, struct ali
 	    bitmap_set_bit (ai->dereferenced_ptrs_load, DECL_UID (var));
 	}
 
-      if (stmt_escapes_p && num_derefs < num_uses)
+      if (stmt_escape_type != NO_ESCAPE && num_derefs < num_uses)
 	{
 	  /* If STMT is an escape point and STMT contains at
 	     least one direct use of OP, then the value of OP
 	     escapes and so the pointed-to variables need to
 	     be marked call-clobbered.  */
 	  pi->value_escapes_p = 1;
+	  v_ann->escape_mask |= stmt_escape_type;
 
 	  /* If the statement makes a function call, assume
 	     that pointer OP will be dereferenced in a store
Index: tree-ssa-structalias.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-structalias.h,v
retrieving revision 2.4
diff -u -p -r2.4 tree-ssa-structalias.h
--- tree-ssa-structalias.h	10 Jul 2005 00:27:51 -0000	2.4
+++ tree-ssa-structalias.h	26 Sep 2005 20:57:12 -0000
@@ -80,7 +80,7 @@ struct alias_info
 #define NUM_REFERENCES_SET(ANN, VAL) (ANN)->common.aux = (void*) ((void *)(VAL))
 
 /* In tree-ssa-alias.c.  */
-bool is_escape_site (tree, struct alias_info *);
+enum escape_type is_escape_site (tree, struct alias_info *);
 
 /* In tree-ssa-structalias.c.  */
 extern void compute_points_to_sets (struct alias_info *);

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