size_t j;
tree ptr = VARRAY_TREE (ai->processed_ptrs, i);
tree name_tag = SSA_NAME_PTR_INFO (ptr)->name_mem_tag;
- varray_type aliases;
+ VEC(tree,gc) *aliases;
+ tree alias;
if (name_tag == NULL_TREE)
continue;
aliases = var_ann (name_tag)->may_aliases;
- for (j = 0; aliases && j < VARRAY_ACTIVE_SIZE (aliases); j++)
+ for (j = 0; VEC_iterate (tree, aliases, j, alias); j++)
{
- tree alias = VARRAY_TREE (aliases, j);
var_ann_t ann = var_ann (alias);
if ((!MTAG_P (alias)
{
tree new_alias;
- gcc_assert (VARRAY_ACTIVE_SIZE (ann->may_aliases) == 1);
+ gcc_assert (VEC_length (tree, ann->may_aliases) == 1);
- new_alias = VARRAY_TREE (ann->may_aliases, 0);
+ new_alias = VEC_index (tree, ann->may_aliases, 0);
replace_may_alias (name_tag, j, new_alias);
}
}
size_t i;
var_ann_t v_ann = get_var_ann (var);
var_ann_t a_ann = get_var_ann (alias);
+ tree al;
/* Don't allow self-referential aliases. */
gcc_assert (var != alias);
#endif
if (v_ann->may_aliases == NULL)
- VARRAY_TREE_INIT (v_ann->may_aliases, 2, "aliases");
+ v_ann->may_aliases = VEC_alloc (tree, gc, 2);
/* Avoid adding duplicates. */
- for (i = 0; i < VARRAY_ACTIVE_SIZE (v_ann->may_aliases); i++)
- if (alias == VARRAY_TREE (v_ann->may_aliases, i))
+ for (i = 0; VEC_iterate (tree, v_ann->may_aliases, i, al); i++)
+ if (alias == al)
return;
/* If VAR is a call-clobbered variable, so is its new ALIAS.
else if (is_call_clobbered (alias))
mark_call_clobbered (var);
- VARRAY_PUSH_TREE (v_ann->may_aliases, alias);
+ VEC_safe_push (tree, gc, v_ann->may_aliases, alias);
a_ann->is_alias_tag = 1;
}
replace_may_alias (tree var, size_t i, tree new_alias)
{
var_ann_t v_ann = var_ann (var);
- VARRAY_TREE (v_ann->may_aliases, i) = new_alias;
+ VEC_replace (tree, v_ann->may_aliases, i, new_alias);
/* If VAR is a call-clobbered variable, so is NEW_ALIAS.
FIXME, call-clobbering should only depend on whether an address
void
dump_may_aliases_for (FILE *file, tree var)
{
- varray_type aliases;
+ VEC(tree, gc) *aliases;
if (TREE_CODE (var) == SSA_NAME)
var = SSA_NAME_VAR (var);
if (aliases)
{
size_t i;
+ tree al;
fprintf (file, "{ ");
- for (i = 0; i < VARRAY_ACTIVE_SIZE (aliases); i++)
+ for (i = 0; VEC_iterate (tree, aliases, i, al); i++)
{
- print_generic_expr (file, VARRAY_TREE (aliases, i), dump_flags);
+ print_generic_expr (file, al, dump_flags);
fprintf (file, " ");
}
fprintf (file, "}");
is_aliased_with (tree tag, tree sym)
{
size_t i;
- varray_type aliases;
+ VEC(tree,gc) *aliases;
+ tree al;
if (var_ann (sym)->is_alias_tag)
{
if (aliases == NULL)
return false;
- for (i = 0; i < VARRAY_ACTIVE_SIZE (aliases); i++)
- if (VARRAY_TREE (aliases, i) == sym)
+ for (i = 0; VEC_iterate (tree, aliases, i, al); i++)
+ if (al == sym)
return true;
}
else
if (aliases == NULL)
return false;
- for (i = 0; i < VARRAY_ACTIVE_SIZE (aliases); i++)
- if (VARRAY_TREE (aliases, i) == tag)
+ for (i = 0; VEC_iterate (tree, aliases, i, al); i++)
+ if (al == tag)
return true;
}
void
add_type_alias (tree ptr, tree var)
{
- varray_type aliases;
- tree tag;
+ 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->type_mem_tag == NULL_TREE)
{
mark_sym_for_renaming (tag);
if ((aliases = var_ann (tag)->may_aliases) != NULL)
{
- size_t i;
- for (i = 0; i < VARRAY_ACTIVE_SIZE (aliases); i++)
- mark_sym_for_renaming (VARRAY_TREE (aliases, i));
+ 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
aliases of VAR will need to be updated. */
if ((aliases = var_ann (var)->may_aliases) != NULL)
{
- size_t i;
- for (i = 0; i < VARRAY_ACTIVE_SIZE (aliases); i++)
- mark_sym_for_renaming (VARRAY_TREE (aliases, i));
+ for (i = 0; VEC_iterate (tree, aliases, i, al); i++)
+ mark_sym_for_renaming (al);
}
VEC_free (tree, heap, varvec);
}
same defs/uses/vdefs/vuses will be found after replacing a reference
to var (or ARRAY_REF to var) with an INDIRECT_REF to ptr whose value
is the address of var. */
- varray_type aliases = v_ann->may_aliases;
+ VEC(tree, gc) *aliases = v_ann->may_aliases;
if ((aliases != NULL)
- && (VARRAY_ACTIVE_SIZE (aliases) == 1))
+ && (VEC_length (tree, aliases) == 1))
{
- tree ali = VARRAY_TREE (aliases, 0);
+ tree ali = VEC_index (tree, aliases, 0);
if (TREE_CODE (ali) == TYPE_MEMORY_TAG)
{
add_may_alias (tag, var);
else
{
- size_t i;
+ unsigned i;
+ tree al;
- for (i = 0; i < VARRAY_ACTIVE_SIZE (aliases); i++)
- add_may_alias (tag, VARRAY_TREE (aliases, i));
+ for (i = 0; VEC_iterate (tree, aliases, i, al); i++)
+ add_may_alias (tag, al);
}
}
}
{
size_t j;
var_ann_t ann;
- varray_type may_aliases;
+ VEC(tree,gc) *may_aliases;
+ tree alias;
ann = var_ann (var);
may_aliases = ann->may_aliases;
- for (j = 0; may_aliases && j < VARRAY_ACTIVE_SIZE (may_aliases); j++)
+ for (j = 0; VEC_iterate (tree, may_aliases, j, alias); j++)
{
- tree alias = VARRAY_TREE (may_aliases, j);
-
bitmap_set_bit (visited, DECL_UID (alias));
if (!may_be_aliased (alias))
if (tmt)
{
size_t i;
- varray_type aliases = var_ann (tmt)->may_aliases;
+ VEC(tree,gc) *aliases = var_ann (tmt)->may_aliases;
+ tree alias;
+
bitmap_clear (type_aliases);
- for (i = 0; aliases && i < VARRAY_ACTIVE_SIZE (aliases); i++)
- {
- tree alias = VARRAY_TREE (aliases, i);
- bitmap_set_bit (type_aliases, DECL_UID (alias));
- }
+ for (i = 0; VEC_iterate (tree, aliases, i, alias); i++)
+ bitmap_set_bit (type_aliases, DECL_UID (alias));
/* When grouping, we may have added PTR's type tag into the
alias set of PTR's name tag. To prevent a false