summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-structalias.c
diff options
context:
space:
mode:
authordberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4>2005-07-11 02:16:20 +0000
committerdberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4>2005-07-11 02:16:20 +0000
commit011e265ef254161e2abf8da3f3921227025be4ea (patch)
tree5a55d44f31d83bfd5cd0d0694c7e596ac756beb1 /gcc/tree-ssa-structalias.c
parentaa6b73d050e7e40d0e704446e621cd35e8249209 (diff)
downloadgcc-011e265ef254161e2abf8da3f3921227025be4ea.tar.gz
2005-07-10 Daniel Berlin <dberlin@dberlin.org>
* tree-ssa-structalias.c (update_alias_info): Change counting of references to not include vdefs. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101861 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r--gcc/tree-ssa-structalias.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index 7ec5270ad77..412a96619f3 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -2501,9 +2501,9 @@ update_alias_info (tree stmt, struct alias_info *ai)
{
bitmap addr_taken;
use_operand_p use_p;
- def_operand_p def_p;
ssa_op_iter iter;
bool stmt_escapes_p = is_escape_site (stmt, ai);
+ tree op;
/* Mark all the variables whose address are taken by the statement. */
addr_taken = addresses_taken (stmt);
@@ -2629,16 +2629,27 @@ update_alias_info (tree stmt, struct alias_info *ai)
}
}
- /* Update reference counter for definitions to any potentially
- aliased variable. This is used in the alias grouping heuristics. */
- FOR_EACH_PHI_OR_STMT_DEF (def_p, stmt, iter, SSA_OP_ALL_DEFS)
+ if (TREE_CODE (stmt) == PHI_NODE)
+ return;
+
+ /* Update reference counter for definitions to any
+ potentially aliased variable. This is used in the alias
+ grouping heuristics. */
+ FOR_EACH_SSA_TREE_OPERAND (op, stmt, iter, SSA_OP_DEF)
{
- tree op = DEF_FROM_PTR (def_p);
tree var = SSA_NAME_VAR (op);
var_ann_t ann = var_ann (var);
bitmap_set_bit (ai->written_vars, DECL_UID (var));
if (may_be_aliased (var))
NUM_REFERENCES_INC (ann);
+
+ }
+
+ /* Mark variables in V_MAY_DEF operands as being written to. */
+ FOR_EACH_SSA_TREE_OPERAND (op, stmt, iter, SSA_OP_VIRTUAL_DEFS)
+ {
+ tree var = DECL_P (op) ? op : SSA_NAME_VAR (op);
+ bitmap_set_bit (ai->written_vars, DECL_UID (var));
}
}