diff options
author | Richard Guenther <rguenther@suse.de> | 2006-01-05 15:30:44 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2006-01-05 15:30:44 +0000 |
commit | 758cf3f28ab51cee208d52505ed6fb7c1d1b0bd1 (patch) | |
tree | 1be6d45ed8f38489c81824750e671fab251a6b5a /gcc/tree-ssa-operands.c | |
parent | ad0926324df676c7e296d3a3e40c775d5a2b5716 (diff) | |
download | gcc-758cf3f28ab51cee208d52505ed6fb7c1d1b0bd1.zip gcc-758cf3f28ab51cee208d52505ed6fb7c1d1b0bd1.tar.gz gcc-758cf3f28ab51cee208d52505ed6fb7c1d1b0bd1.tar.bz2 |
re PR tree-optimization/22555 (array in struct disables salias subvars for other fields)
2006-01-05 Richard Guenther <rguenther@suse.de>
PR tree-optimization/22555
* tree-ssa-alias.c (create_overlap_variables_for): Do not give up,
if one structure field is an array.
* tree-ssa-operands.c (get_expr_operands): Continue scanning
operands even if we found a subvar, but ignore VOPs in this
case.
* tree-ssa-loop-ivopts.c (rewrite_use): Mark new vars in stmt
for renaming.
* tree-ssa-loop.c (pass_iv_optimize): Schedule TODO_update_ssa.
* gcc.dg/tree-ssa/alias-3.c: New testcase.
From-SVN: r109381
Diffstat (limited to 'gcc/tree-ssa-operands.c')
-rw-r--r-- | gcc/tree-ssa-operands.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c index 01bf7f2..b7319de 100644 --- a/gcc/tree-ssa-operands.c +++ b/gcc/tree-ssa-operands.c @@ -1126,6 +1126,7 @@ get_expr_operands (tree stmt, tree *expr_p, int flags) { tree ref; HOST_WIDE_INT offset, size, maxsize; + bool none = true; /* This component ref becomes an access to all of the subvariables it can touch, if we can determine that, but *NOT* the real one. If we can't determine which fields we could touch, the recursion @@ -1143,16 +1144,22 @@ get_expr_operands (tree stmt, tree *expr_p, int flags) if (overlap_subvar (offset, maxsize, sv, &exact)) { int subvar_flags = flags; + none = false; if (!exact || size != maxsize) subvar_flags &= ~opf_kill_def; add_stmt_operand (&sv->var, s_ann, subvar_flags); } } + if (!none) + flags |= opf_no_vops; } - else - get_expr_operands (stmt, &TREE_OPERAND (expr, 0), - flags & ~opf_kill_def); + + /* Even if we found subvars above we need to ensure to see + immediate uses for d in s.a[d]. In case of s.a having + a subvar we'd miss it otherwise. */ + get_expr_operands (stmt, &TREE_OPERAND (expr, 0), + flags & ~opf_kill_def); if (code == COMPONENT_REF) { |