re PR tree-optimization/26421 (tree-ssa-alias.c:find_used_portions considers foo(&var) use all elements of var)

2006-02-26  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/26421
	* tree-ssa-alias.c (find_used_portions): Don't treat parameters
	in function calls that are ADDR_EXPRs as using the whole structure.

	* gcc.dg/tree-ssa/pr26421.c: New testcase.

From-SVN: r111461
This commit is contained in:
Richard Guenther 2006-02-26 21:02:43 +00:00 committed by Richard Biener
parent 37818e7cec
commit 651402f11e
4 changed files with 41 additions and 0 deletions

View file

@ -1,3 +1,9 @@
2006-02-26 Richard Guenther <rguenther@suse.de>
PR tree-optimization/26421
* tree-ssa-alias.c (find_used_portions): Don't treat parameters
in function calls that are ADDR_EXPRs as using the whole structure.
2006-02-26 Steven Bosscher <stevenb.gcc@gmail.com>
* common.opt (-floop-optimize, -frerun-loop-opt): Remove.

View file

@ -1,3 +1,8 @@
2006-02-26 Richard Guenther <rguenther@suse.de>
PR tree-optimization/26421
* gcc.dg/tree-ssa/pr26421.c: New testcase.
2006-02-26 Steven Bosscher <stevenb.gcc@gmail.com>
* gcc.dg/20031201-1.c: Don't use -frerun-loop-opt.

View file

@ -0,0 +1,19 @@
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-alias1-vops" } */
typedef struct {
int i;
int j;
int k;
} Foo;
void bar(Foo*);
void foo(void)
{
Foo a;
a.i = 1;
bar(&a);
}
/* { dg-final { scan-tree-dump-times "V_MAY_DEF" 1 "alias1" } } */
/* { dg-final { cleanup-tree-dump "alias1" } } */

View file

@ -3078,6 +3078,17 @@ find_used_portions (tree *tp, int *walk_subtrees, void *lhs_p)
}
}
break;
case CALL_EXPR:
{
tree *arg;
for (arg = &TREE_OPERAND (*tp, 1); *arg; arg = &TREE_CHAIN (*arg))
{
if (TREE_CODE (TREE_VALUE (*arg)) != ADDR_EXPR)
find_used_portions (&TREE_VALUE (*arg), walk_subtrees, NULL);
}
*walk_subtrees = 0;
return NULL_TREE;
}
case VAR_DECL:
case PARM_DECL:
case RESULT_DECL: