summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4>2007-06-10 20:21:48 +0000
committerdberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4>2007-06-10 20:21:48 +0000
commit5f414da7343d7257f96b6abb4e3b269af30a01b6 (patch)
tree38ee55d33e7de3cac90868910357066e402087c5
parenta801596b627fbae8ca23d0d098b7b5c31ba30047 (diff)
downloadgcc-5f414da7343d7257f96b6abb4e3b269af30a01b6.tar.gz
2007-06-09 Daniel Berlin <dberlin@dberlin.org>
* tree-ssa-structalias.c (set_uids_in_ptset): Add is_deref'd parameter, use it. (find_what_p_points_to): Pass new parameter to set_uids_in_ptset. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@125603 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/tree-ssa-structalias.c17
2 files changed, 17 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1cba951f45e..e4b34951006 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2007-06-09 Daniel Berlin <dberlin@dberlin.org>
+ * tree-ssa-structalias.c (set_uids_in_ptset): Add is_deref'd
+ parameter, use it.
+ (find_what_p_points_to): Pass new parameter to set_uids_in_ptset.
+
+2007-06-09 Daniel Berlin <dberlin@dberlin.org>
+
* tree-data-ref.c (dr_may_alias_p): Check that decl_a != decl_b,
and allow DECL_P here.
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index 48f85b77b5a..6b470b3143f 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -4290,10 +4290,12 @@ shared_bitmap_add (bitmap pt_vars)
/* Set bits in INTO corresponding to the variable uids in solution set
FROM, which came from variable PTR.
For variables that are actually dereferenced, we also use type
- based alias analysis to prune the points-to sets. */
+ based alias analysis to prune the points-to sets.
+ IS_DEREFED is true if PTR was directly dereferenced, which we use to
+ help determine whether we are we are allowed to prune using TBAA. */
static void
-set_uids_in_ptset (tree ptr, bitmap into, bitmap from)
+set_uids_in_ptset (tree ptr, bitmap into, bitmap from, bool is_derefed)
{
unsigned int i;
bitmap_iterator bi;
@@ -4329,7 +4331,7 @@ set_uids_in_ptset (tree ptr, bitmap into, bitmap from)
if (sft)
{
var_alias_set = get_alias_set (sft);
- if (!vi->directly_dereferenced
+ if ((!is_derefed && !vi->directly_dereferenced)
|| alias_sets_conflict_p (ptr_alias_set, var_alias_set))
bitmap_set_bit (into, DECL_UID (sft));
}
@@ -4343,7 +4345,7 @@ set_uids_in_ptset (tree ptr, bitmap into, bitmap from)
else
{
var_alias_set = get_alias_set (vi->decl);
- if (!vi->directly_dereferenced
+ if ((!is_derefed && !vi->directly_dereferenced)
|| alias_sets_conflict_p (ptr_alias_set, var_alias_set))
bitmap_set_bit (into, DECL_UID (vi->decl));
}
@@ -4539,14 +4541,17 @@ find_what_p_points_to (tree p)
stats.points_to_sets_created++;
/* Instead of using pt_anything, we instead merge in the SMT
- aliases for the underlying SMT. */
+ aliases for the underlying SMT. In addition, if they
+ could have pointed to anything, they could point to
+ global memory. */
if (was_pt_anything)
{
merge_smts_into (p, finished_solution);
pi->pt_global_mem = 1;
}
- set_uids_in_ptset (vi->decl, finished_solution, vi->solution);
+ set_uids_in_ptset (vi->decl, finished_solution, vi->solution,
+ vi->directly_dereferenced);
result = shared_bitmap_lookup (finished_solution);
if (!result)