Commit 379c6f48 by Richard Guenther Committed by Richard Biener

tree-ssa-structalias.c (build_succ_graph): Properly make variables escape if…

tree-ssa-structalias.c (build_succ_graph): Properly make variables escape if they are stored to anything.

2009-11-08  Richard Guenther  <rguenther@suse.de>

	* tree-ssa-structalias.c (build_succ_graph): Properly make
	variables escape if they are stored to anything.

	* gcc.dg/torture/pta-escape-1.c: New testcase.

From-SVN: r154010
parent d770e88d
2009-11-08 Richard Guenther <rguenther@suse.de>
* tree-ssa-structalias.c (build_succ_graph): Properly make
variables escape if they are stored to anything.
2009-11-08 Richard Guenther <rguenther@suse.de>
PR rtl-optimization/41928
* loop-invariant.c (free_loop_data): If we didn't allocate
loop data do not try to free it.
2009-11-08 Richard Guenther <rguenther@suse.de>
* gcc.dg/torture/pta-escape-1.c: New testcase.
2009-11-08 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/rep_clause4.adb: New test.
......
/* { dg-do run } */
/* { dg-options "-fdump-tree-alias" } */
/* { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
int *p;
void __attribute__((noinline,noclone))
bar (void)
{
*p = 1;
}
int __attribute__((noinline,noclone))
foo (__SIZE_TYPE__ addr)
{
int i;
/* q points to ANYTHING */
int **q = (int **)addr;
/* this store needs to cause i to escape */
*q = &i;
i = 0;
/* and thus be clobbered by this function call */
bar ();
return i;
}
extern void abort (void);
int
main()
{
if (foo ((__SIZE_TYPE__)&p) != 1)
abort ();
return 0;
}
/* { dg-final { scan-tree-dump "ESCAPED = { i }" "alias" } } */
/* { dg-final { cleanup-tree-dump "alias" } } */
......@@ -1278,6 +1278,9 @@ build_succ_graph (void)
&& get_varinfo (i)->may_have_pointers)
add_graph_edge (graph, find (i), t);
}
/* Everything stored to ANYTHING also potentially escapes. */
add_graph_edge (graph, find (escaped_id), t);
}
......
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