diff options
author | Richard Guenther <rguenther@suse.de> | 2010-04-21 09:37:22 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2010-04-21 09:37:22 +0000 |
commit | 11152c95365532ec04eb12c3fd418b165a290a23 (patch) | |
tree | be1f0c8485376e56857fd80db6dc76a75626f21a /gcc/tree-ssa-structalias.c | |
parent | 0f2f44c007550bdf388940b6a09da1eeaa9caa3f (diff) | |
download | gcc-11152c95365532ec04eb12c3fd418b165a290a23.zip gcc-11152c95365532ec04eb12c3fd418b165a290a23.tar.gz gcc-11152c95365532ec04eb12c3fd418b165a290a23.tar.bz2 |
tree-ssa-structalias.c (do_ds_constraint): Avoid escaping to non-pointer objects.
2010-04-21 Richard Guenther <rguenther@suse.de>
* tree-ssa-structalias.c (do_ds_constraint): Avoid escaping
to non-pointer objects.
* gcc.dg/ipa/ipa-pta-11.c: Adjust.
From-SVN: r158591
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r-- | gcc/tree-ssa-structalias.c | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index 492907e..207cb17 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -1746,6 +1746,7 @@ do_ds_constraint (constraint_t c, bitmap delta) unsigned int j; bitmap_iterator bi; HOST_WIDE_INT loff = c->lhs.offset; + bool escaped_p = false; /* Our IL does not allow this. */ gcc_assert (c->rhs.offset == 0); @@ -1792,22 +1793,6 @@ do_ds_constraint (constraint_t c, bitmap delta) unsigned int t; HOST_WIDE_INT fieldoffset = v->offset + loff; - /* If v is a global variable then this is an escape point. */ - if (v->is_global_var) - { - t = find (escaped_id); - if (add_graph_edge (graph, t, rhs) - && bitmap_ior_into (get_varinfo (t)->solution, sol) - && !TEST_BIT (changed, t)) - { - SET_BIT (changed, t); - changed_count++; - } - } - - if (v->is_special_var) - continue; - if (v->is_full_var) fieldoffset = v->offset; else if (loff != 0) @@ -1820,6 +1805,25 @@ do_ds_constraint (constraint_t c, bitmap delta) { if (v->may_have_pointers) { + /* If v is a global variable then this is an escape point. */ + if (v->is_global_var + && !escaped_p) + { + t = find (escaped_id); + if (add_graph_edge (graph, t, rhs) + && bitmap_ior_into (get_varinfo (t)->solution, sol) + && !TEST_BIT (changed, t)) + { + SET_BIT (changed, t); + changed_count++; + } + /* Enough to let rhs escape once. */ + escaped_p = true; + } + + if (v->is_special_var) + break; + t = find (v->id); if (add_graph_edge (graph, t, rhs) && bitmap_ior_into (get_varinfo (t)->solution, sol) |