Commit 11152c95 by Richard Guenther Committed by Richard Biener

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
parent 0f2f44c0
2010-04-21 Richard Guenther <rguenther@suse.de>
* tree-ssa-structalias.c (do_ds_constraint): Avoid escaping
to non-pointer objects.
2010-04-21 Jakub Jelinek <jakub@redhat.com> 2010-04-21 Jakub Jelinek <jakub@redhat.com>
* dwarf2out.c (add_var_loc_to_decl): Add LABEL argument. Drop * dwarf2out.c (add_var_loc_to_decl): Add LABEL argument. Drop
......
2010-04-21 Richard Guenther <rguenther@suse.de>
* gcc.dg/ipa/ipa-pta-11.c: Adjust.
2010-04-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 2010-04-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* gcc.dg/torture/builtin-cproj-3.c: New. * gcc.dg/torture/builtin-cproj-3.c: New.
......
...@@ -29,5 +29,5 @@ int main() ...@@ -29,5 +29,5 @@ int main()
/* It isn't clear if the escape if l is strictly necessary, if it were /* It isn't clear if the escape if l is strictly necessary, if it were
we should have i, r and s in ESCAPED as well. */ we should have i, r and s in ESCAPED as well. */
/* { dg-final { scan-ipa-dump "ESCAPED = { ESCAPED NONLOCAL l k }" "pta" } } */ /* { dg-final { scan-ipa-dump "ESCAPED = { l k }" "pta" } } */
/* { dg-final { cleanup-ipa-dump "pta" } } */ /* { dg-final { cleanup-ipa-dump "pta" } } */
...@@ -1746,6 +1746,7 @@ do_ds_constraint (constraint_t c, bitmap delta) ...@@ -1746,6 +1746,7 @@ do_ds_constraint (constraint_t c, bitmap delta)
unsigned int j; unsigned int j;
bitmap_iterator bi; bitmap_iterator bi;
HOST_WIDE_INT loff = c->lhs.offset; HOST_WIDE_INT loff = c->lhs.offset;
bool escaped_p = false;
/* Our IL does not allow this. */ /* Our IL does not allow this. */
gcc_assert (c->rhs.offset == 0); gcc_assert (c->rhs.offset == 0);
...@@ -1792,22 +1793,6 @@ do_ds_constraint (constraint_t c, bitmap delta) ...@@ -1792,22 +1793,6 @@ do_ds_constraint (constraint_t c, bitmap delta)
unsigned int t; unsigned int t;
HOST_WIDE_INT fieldoffset = v->offset + loff; 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) if (v->is_full_var)
fieldoffset = v->offset; fieldoffset = v->offset;
else if (loff != 0) else if (loff != 0)
...@@ -1820,6 +1805,25 @@ do_ds_constraint (constraint_t c, bitmap delta) ...@@ -1820,6 +1805,25 @@ do_ds_constraint (constraint_t c, bitmap delta)
{ {
if (v->may_have_pointers) 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); t = find (v->id);
if (add_graph_edge (graph, t, rhs) if (add_graph_edge (graph, t, rhs)
&& bitmap_ior_into (get_varinfo (t)->solution, sol) && bitmap_ior_into (get_varinfo (t)->solution, sol)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment