Commit 472c7fbd by Richard Guenther Committed by Richard Biener

re PR tree-optimization/39120 (Missed escape constraints for call results)

2009-03-27  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/39120
	* tree-ssa-structalias.c (handle_rhs_call): Fill out return
	constraints.
	(handle_lhs_call): Process return constraints.  Add escape
	constraints if necessary.
	(handle_const_call): Fill out return constraints.  Make nested
	case more precise.  Avoid consttmp if possible.
	(handle_pure_call): Fill out return constraints.  Avoid
	callused if possible.
	(find_func_aliases): Simplify call handling.

	* gcc.c-torture/execute/pr39120.c: New testcase.

2009-03-27  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/39120
	* tree-ssa-structalias.c (do_sd_constraint): Do not use CALLUSED
	as a representative.
	(solve_graph): Do propagate CALLUSED.
	(handle_pure_call): Use a scalar constraint from CALLUSED for
	the return value.
	(find_what_p_points_to): CALLUSED shall not appear in poins-to
	solutions.

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

From-SVN: r145137
parent d9223014
2009-03-27 Richard Guenther <rguenther@suse.de>
PR tree-optimization/39120
* tree-ssa-structalias.c (handle_rhs_call): Fill out return
constraints.
(handle_lhs_call): Process return constraints. Add escape
constraints if necessary.
(handle_const_call): Fill out return constraints. Make nested
case more precise. Avoid consttmp if possible.
(handle_pure_call): Fill out return constraints. Avoid
callused if possible.
(find_func_aliases): Simplify call handling.
2009-03-27 Richard Guenther <rguenther@suse.de>
PR tree-optimization/39120
* tree-ssa-structalias.c (do_sd_constraint): Do not use CALLUSED
as a representative.
(solve_graph): Do propagate CALLUSED.
(handle_pure_call): Use a scalar constraint from CALLUSED for
the return value.
(find_what_p_points_to): CALLUSED shall not appear in poins-to
solutions.
2009-03-27 H.J. Lu <hongjiu.lu@intel.com>
PR c/39323
......
2009-03-27 Richard Guenther <rguenther@suse.de>
PR tree-optimization/39120
* gcc.c-torture/execute/pr39120.c: New testcase.
2009-03-27 Richard Guenther <rguenther@suse.de>
PR tree-optimization/39120
* gcc.dg/torture/pta-callused-1.c: New testcase.
2009-03-27 H.J. Lu <hongjiu.lu@intel.com>
PR c/39323
......
struct X { int *p; } x;
struct X __attribute__((noinline))
foo(int *p) { struct X x; x.p = p; return x; }
void __attribute((noinline))
bar() { *x.p = 1; }
extern void abort (void);
int main()
{
int i = 0;
x = foo(&i);
bar();
if (i != 1)
abort ();
return 0;
}
/* { dg-do run } */
/* { dg-options "-fdump-tree-alias" } */
/* { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
volatile int i;
int ** __attribute__((noinline,pure)) foo(int **p) { i; return p; }
int bar(void)
{
int i = 0, j = 1;
int *p, **q;
p = &i;
q = foo(&p);
*q = &j;
return *p;
}
extern void abort (void);
int main()
{
if (bar() != 1)
abort ();
return 0;
}
/* { dg-final { scan-tree-dump "p.._., name memory tag: NMT..., is dereferenced, points-to vars: { i j }" "alias" } } */
/* { dg-final { cleanup-tree-dump "alias" } } */
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