aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/tree-ssa-alias.c32
2 files changed, 25 insertions, 13 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a64b0b0..43e61a6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2008-05-28 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/36339
+ * tree-ssa-alias.c (set_initial_properties): Move pt_anything
+ and clobbering code out of the loop.
+
2008-05-28 Andreas Krebbel <krebbel1@de.ibm.com>
* config/s390/constraints.md ('b', 'C', 'D', 'e'): New constraint
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c
index 983e321..4f66154 100644
--- a/gcc/tree-ssa-alias.c
+++ b/gcc/tree-ssa-alias.c
@@ -521,6 +521,8 @@ set_initial_properties (struct alias_info *ai)
referenced_var_iterator rvi;
tree var;
tree ptr;
+ bool any_pt_anything = false;
+ enum escape_type pt_anything_mask = 0;
FOR_EACH_REFERENCED_VAR (var, rvi)
{
@@ -573,19 +575,8 @@ set_initial_properties (struct alias_info *ai)
}
else if (pi->pt_anything)
{
- bitmap_iterator bi;
- unsigned int j;
-
- /* If we do not have the points-to set filled out we
- still need to honor that this escaped pointer points
- to anything. */
- EXECUTE_IF_SET_IN_BITMAP (gimple_addressable_vars (cfun),
- 0, j, bi)
- {
- tree var = referenced_var (j);
- if (!unmodifiable_var_p (var))
- mark_call_clobbered (var, pi->escape_mask);
- }
+ any_pt_anything = true;
+ pt_anything_mask |= pi->escape_mask;
}
}
@@ -619,6 +610,21 @@ set_initial_properties (struct alias_info *ai)
MTAG_GLOBAL (tag) = true;
}
}
+
+ /* If a pt_anything pointer escaped we need to mark all addressable
+ variables call clobbered. */
+ if (any_pt_anything)
+ {
+ bitmap_iterator bi;
+ unsigned int j;
+
+ EXECUTE_IF_SET_IN_BITMAP (gimple_addressable_vars (cfun), 0, j, bi)
+ {
+ tree var = referenced_var (j);
+ if (!unmodifiable_var_p (var))
+ mark_call_clobbered (var, pt_anything_mask);
+ }
+ }
}
/* Compute which variables need to be marked call clobbered because