diff options
author | dnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-07-01 03:55:28 +0000 |
---|---|---|
committer | dnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-07-01 03:55:28 +0000 |
commit | 9df73626e16e031cdb93f615bfb07869307c5b86 (patch) | |
tree | 8ffa65c8288eee005ef263ef8b23ad166acfef7b /gcc/tree-ssa-alias.c | |
parent | 5a0cc58f1aee363c7d75545ae08895b03613b2cd (diff) | |
download | gcc-9df73626e16e031cdb93f615bfb07869307c5b86.tar.gz |
PR 21584
PR 22219
* tree-ssa-alias.c (create_name_tags): Also process
non-dereferenced pointers.
Remove argument 'ai'. Update all callers.
testsuite/ChangeLog
PR 21584
PR 22219
* g++.dg/tree-ssa/pr21584-1.C: New test.
* g++.dg/tree-ssa/pr21584-2.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101498 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-alias.c')
-rw-r--r-- | gcc/tree-ssa-alias.c | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c index 91a01d2d48a..39d9fdecab8 100644 --- a/gcc/tree-ssa-alias.c +++ b/gcc/tree-ssa-alias.c @@ -791,14 +791,21 @@ compute_points_to_and_addr_escape (struct alias_info *ai) are assigned the same name tag. */ static void -create_name_tags (struct alias_info *ai) +create_name_tags (void) { size_t i; - for (i = 0; i < VARRAY_ACTIVE_SIZE (ai->processed_ptrs); i++) + for (i = 1; i < num_ssa_names; i++) { - tree ptr = VARRAY_TREE (ai->processed_ptrs, i); - struct ptr_info_def *pi = SSA_NAME_PTR_INFO (ptr); + tree ptr = ssa_name (i); + struct ptr_info_def *pi; + + if (!ptr + || !POINTER_TYPE_P (TREE_TYPE (ptr)) + || !SSA_NAME_PTR_INFO (ptr)) + continue; + + pi = SSA_NAME_PTR_INFO (ptr); if (pi->pt_anything || !pi->is_dereferenced) { @@ -824,10 +831,15 @@ create_name_tags (struct alias_info *ai) problems if they both had different name tags because they would have different SSA version numbers (which would force us to take the name tags in and out of SSA). */ - for (j = 0; j < i; j++) + for (j = 1; j < i; j++) { - tree q = VARRAY_TREE (ai->processed_ptrs, j); - struct ptr_info_def *qi = SSA_NAME_PTR_INFO (q); + tree q = ssa_name (j); + struct ptr_info_def *qi; + + if (!q || !POINTER_TYPE_P (TREE_TYPE (q))) + continue; + + qi = SSA_NAME_PTR_INFO (q); if (qi && qi->pt_vars @@ -896,7 +908,8 @@ compute_flow_sensitive_aliasing (struct alias_info *ai) find_what_p_points_to (ptr); } } - create_name_tags (ai); + + create_name_tags (); for (i = 0; i < VARRAY_ACTIVE_SIZE (ai->processed_ptrs); i++) { |