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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109381
138bc75d-0d04-0410-961f-
82ee72b054a4
+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.
+
2006-01-05 Richard Earnshaw <rearnsha@arm.com>
PR middle-end/24998
2006-01-05 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/22555
+ * gcc.dg/tree-ssa/alias-3.c: New testcase.
+
+2006-01-05 Richard Guenther <rguenther@suse.de>
Diego Novillo <dnovillo@redhat.com>
* gcc.dg/tree-ssa/loop-11.c: Deal with removed vars pass.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+struct {
+ int i;
+ int j;
+ int x[2];
+} a;
+
+int foo(void)
+{
+ a.i = 1;
+ a.j = 0;
+ a.x[0] = 0;
+ return a.i + a.j;
+}
+
+/* { dg-final { scan-tree-dump "return 1;" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
{
if (!fo->size
|| TREE_CODE (fo->size) != INTEGER_CST
- || TREE_CODE (fo->type) == ARRAY_TYPE
|| fo->offset < 0)
{
notokay = true;
default:
gcc_unreachable ();
}
- update_stmt (use->stmt);
+ mark_new_vars_to_rename (use->stmt);
}
/* Rewrite the uses using the selected induction variables. */
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_dump_func | TODO_verify_loops, /* todo_flags_finish */
+ TODO_dump_func
+ | TODO_verify_loops
+ | TODO_update_ssa, /* todo_flags_finish */
0 /* letter */
};
{
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
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)
{