tree-ssa-alias.c (set_initial_properties, [...]): Use VEC instead of VARRAY.

* tree-ssa-alias.c (set_initial_properties, init_alias_info,
	delete_alias_info, compute_flow_sensitive_aliasing,
	group_aliases): Use VEC instead of VARRAY.
	* tree-ssa-structalias.c (update_alias_info): Likewise.
	* tree-ssa-structalias.h (alias_info): Change the type of
	processed_ptrs to VEC(tree,heap) *.

From-SVN: r112903
This commit is contained in:
Kazu Hirata 2006-04-12 22:55:28 +00:00 committed by Kazu Hirata
parent 86066f9bd4
commit d96f49bf64
4 changed files with 20 additions and 12 deletions

View File

@ -1,3 +1,12 @@
2006-04-12 Kazu Hirata <kazu@codesourcery.com>
* tree-ssa-alias.c (set_initial_properties, init_alias_info,
delete_alias_info, compute_flow_sensitive_aliasing,
group_aliases): Use VEC instead of VARRAY.
* tree-ssa-structalias.c (update_alias_info): Likewise.
* tree-ssa-structalias.h (alias_info): Change the type of
processed_ptrs to VEC(tree,heap) *.
2006-04-12 J"orn Rennecke <joern.rennecke@st.com> 2006-04-12 J"orn Rennecke <joern.rennecke@st.com>
PR target/27060 PR target/27060

View File

@ -314,6 +314,7 @@ set_initial_properties (struct alias_info *ai)
unsigned int i; unsigned int i;
referenced_var_iterator rvi; referenced_var_iterator rvi;
tree var; tree var;
tree ptr;
FOR_EACH_REFERENCED_VAR (var, rvi) FOR_EACH_REFERENCED_VAR (var, rvi)
{ {
@ -334,9 +335,8 @@ set_initial_properties (struct alias_info *ai)
} }
} }
for (i = 0; i < VARRAY_ACTIVE_SIZE (ai->processed_ptrs); i++) for (i = 0; VEC_iterate (tree, ai->processed_ptrs, i, ptr); i++)
{ {
tree ptr = VARRAY_TREE (ai->processed_ptrs, i);
struct ptr_info_def *pi = SSA_NAME_PTR_INFO (ptr); struct ptr_info_def *pi = SSA_NAME_PTR_INFO (ptr);
var_ann_t v_ann = var_ann (SSA_NAME_VAR (ptr)); var_ann_t v_ann = var_ann (SSA_NAME_VAR (ptr));
@ -859,7 +859,7 @@ init_alias_info (void)
ai = XCNEW (struct alias_info); ai = XCNEW (struct alias_info);
ai->ssa_names_visited = sbitmap_alloc (num_ssa_names); ai->ssa_names_visited = sbitmap_alloc (num_ssa_names);
sbitmap_zero (ai->ssa_names_visited); sbitmap_zero (ai->ssa_names_visited);
VARRAY_TREE_INIT (ai->processed_ptrs, 50, "processed_ptrs"); ai->processed_ptrs = VEC_alloc (tree, heap, 50);
ai->written_vars = BITMAP_ALLOC (&alias_obstack); ai->written_vars = BITMAP_ALLOC (&alias_obstack);
ai->dereferenced_ptrs_store = BITMAP_ALLOC (&alias_obstack); ai->dereferenced_ptrs_store = BITMAP_ALLOC (&alias_obstack);
ai->dereferenced_ptrs_load = BITMAP_ALLOC (&alias_obstack); ai->dereferenced_ptrs_load = BITMAP_ALLOC (&alias_obstack);
@ -943,7 +943,7 @@ delete_alias_info (struct alias_info *ai)
tree var; tree var;
sbitmap_free (ai->ssa_names_visited); sbitmap_free (ai->ssa_names_visited);
ai->processed_ptrs = NULL; VEC_free (tree, heap, ai->processed_ptrs);
for (i = 0; i < ai->num_addressable_vars; i++) for (i = 0; i < ai->num_addressable_vars; i++)
free (ai->addressable_vars[i]); free (ai->addressable_vars[i]);
@ -1085,20 +1085,19 @@ static void
compute_flow_sensitive_aliasing (struct alias_info *ai) compute_flow_sensitive_aliasing (struct alias_info *ai)
{ {
size_t i; size_t i;
tree ptr;
for (i = 0; i < VARRAY_ACTIVE_SIZE (ai->processed_ptrs); i++) for (i = 0; VEC_iterate (tree, ai->processed_ptrs, i, ptr); i++)
{ {
tree ptr = VARRAY_TREE (ai->processed_ptrs, i);
if (!find_what_p_points_to (ptr)) if (!find_what_p_points_to (ptr))
set_pt_anything (ptr); set_pt_anything (ptr);
} }
create_name_tags (); create_name_tags ();
for (i = 0; i < VARRAY_ACTIVE_SIZE (ai->processed_ptrs); i++) for (i = 0; VEC_iterate (tree, ai->processed_ptrs, i, ptr); i++)
{ {
unsigned j; unsigned j;
tree ptr = VARRAY_TREE (ai->processed_ptrs, i);
struct ptr_info_def *pi = SSA_NAME_PTR_INFO (ptr); struct ptr_info_def *pi = SSA_NAME_PTR_INFO (ptr);
var_ann_t v_ann = var_ann (SSA_NAME_VAR (ptr)); var_ann_t v_ann = var_ann (SSA_NAME_VAR (ptr));
bitmap_iterator bi; bitmap_iterator bi;
@ -1411,6 +1410,7 @@ static void
group_aliases (struct alias_info *ai) group_aliases (struct alias_info *ai)
{ {
size_t i; size_t i;
tree ptr;
/* Sort the POINTERS array in descending order of contributed /* Sort the POINTERS array in descending order of contributed
virtual operands. */ virtual operands. */
@ -1478,10 +1478,9 @@ group_aliases (struct alias_info *ai)
into p_5->field, but that is wrong because there have been into p_5->field, but that is wrong because there have been
modifications to 'SMT.20' in between. To prevent this we have to modifications to 'SMT.20' in between. To prevent this we have to
replace 'a' with 'SMT.20' in the name tag of p_5. */ replace 'a' with 'SMT.20' in the name tag of p_5. */
for (i = 0; i < VARRAY_ACTIVE_SIZE (ai->processed_ptrs); i++) for (i = 0; VEC_iterate (tree, ai->processed_ptrs, i, ptr); i++)
{ {
size_t j; size_t j;
tree ptr = VARRAY_TREE (ai->processed_ptrs, i);
tree name_tag = SSA_NAME_PTR_INFO (ptr)->name_mem_tag; tree name_tag = SSA_NAME_PTR_INFO (ptr)->name_mem_tag;
VEC(tree,gc) *aliases; VEC(tree,gc) *aliases;
tree alias; tree alias;

View File

@ -3041,7 +3041,7 @@ update_alias_info (tree stmt, struct alias_info *ai)
if (!TEST_BIT (ai->ssa_names_visited, SSA_NAME_VERSION (op))) if (!TEST_BIT (ai->ssa_names_visited, SSA_NAME_VERSION (op)))
{ {
SET_BIT (ai->ssa_names_visited, SSA_NAME_VERSION (op)); SET_BIT (ai->ssa_names_visited, SSA_NAME_VERSION (op));
VARRAY_PUSH_TREE (ai->processed_ptrs, op); VEC_safe_push (tree, heap, ai->processed_ptrs, op);
} }
/* If STMT is a PHI node, then it will not have pointer /* If STMT is a PHI node, then it will not have pointer

View File

@ -34,7 +34,7 @@ struct alias_info
sbitmap ssa_names_visited; sbitmap ssa_names_visited;
/* Array of SSA_NAME pointers processed by the points-to collector. */ /* Array of SSA_NAME pointers processed by the points-to collector. */
varray_type processed_ptrs; VEC(tree,heap) *processed_ptrs;
/* ADDRESSABLE_VARS contains all the global variables and locals that /* ADDRESSABLE_VARS contains all the global variables and locals that
have had their address taken. */ have had their address taken. */