Commit 9271a43c by Martin Jambor Committed by Martin Jambor

tree-sra.c (struct access): New field grp_no_warning.

2010-09-22  Martin Jambor  <mjambor@suse.cz>

	* tree-sra.c (struct access): New field grp_no_warning.
	(create_access_replacement): Set TREE_NO_WARNING according to
	 grp_no_warning.
	(create_artificial_child_access): Use build_ref_for_model and set
	grp_no_warning if build_user_friendly_ref_for_offset fails.
	(propagate_subaccesses_across_link): Likewise.

From-SVN: r164515
parent 77167b6f
2010-09-22 Martin Jambor <mjambor@suse.cz>
* tree-sra.c (struct access): New field grp_no_warning.
(create_access_replacement): Set TREE_NO_WARNING according to
grp_no_warning.
(create_artificial_child_access): Use build_ref_for_model and set
grp_no_warning if build_user_friendly_ref_for_offset fails.
(propagate_subaccesses_across_link): Likewise.
2010-09-22 Eric Botcazou <ebotcazou@adacore.com> 2010-09-22 Eric Botcazou <ebotcazou@adacore.com>
PR target/35664 PR target/35664
......
...@@ -216,6 +216,9 @@ struct access ...@@ -216,6 +216,9 @@ struct access
cannot be called from within FOR_EACH_REFERENCED_VAR. */ cannot be called from within FOR_EACH_REFERENCED_VAR. */
unsigned grp_to_be_replaced : 1; unsigned grp_to_be_replaced : 1;
/* Should TREE_NO_WARNING of a replacement be set? */
unsigned grp_no_warning : 1;
/* Is it possible that the group refers to data which might be (directly or /* Is it possible that the group refers to data which might be (directly or
otherwise) modified? */ otherwise) modified? */
unsigned grp_maybe_modified : 1; unsigned grp_maybe_modified : 1;
...@@ -1714,7 +1717,10 @@ create_access_replacement (struct access *access, bool rename) ...@@ -1714,7 +1717,10 @@ create_access_replacement (struct access *access, bool rename)
} }
SET_DECL_DEBUG_EXPR (repl, debug_expr); SET_DECL_DEBUG_EXPR (repl, debug_expr);
DECL_DEBUG_EXPR_IS_FROM (repl) = 1; DECL_DEBUG_EXPR_IS_FROM (repl) = 1;
TREE_NO_WARNING (repl) = TREE_NO_WARNING (access->base); if (access->grp_no_warning)
TREE_NO_WARNING (repl) = 1;
else
TREE_NO_WARNING (repl) = TREE_NO_WARNING (access->base);
} }
else else
TREE_NO_WARNING (repl) = 1; TREE_NO_WARNING (repl) = 1;
...@@ -1970,12 +1976,17 @@ create_artificial_child_access (struct access *parent, struct access *model, ...@@ -1970,12 +1976,17 @@ create_artificial_child_access (struct access *parent, struct access *model,
tree expr = parent->base; tree expr = parent->base;
gcc_assert (!model->grp_unscalarizable_region); gcc_assert (!model->grp_unscalarizable_region);
if (!build_user_friendly_ref_for_offset (&expr, TREE_TYPE (expr), new_offset,
model->type))
return NULL;
access = (struct access *) pool_alloc (access_pool); access = (struct access *) pool_alloc (access_pool);
memset (access, 0, sizeof (struct access)); memset (access, 0, sizeof (struct access));
if (!build_user_friendly_ref_for_offset (&expr, TREE_TYPE (expr), new_offset,
model->type))
{
access->grp_no_warning = true;
expr = build_ref_for_model (EXPR_LOCATION (parent->base), parent->base,
new_offset, model, NULL, false);
}
access->base = parent->base; access->base = parent->base;
access->expr = expr; access->expr = expr;
access->offset = new_offset; access->offset = new_offset;
...@@ -2016,11 +2027,16 @@ propagate_subaccesses_across_link (struct access *lacc, struct access *racc) ...@@ -2016,11 +2027,16 @@ propagate_subaccesses_across_link (struct access *lacc, struct access *racc)
{ {
tree t = lacc->base; tree t = lacc->base;
lacc->type = racc->type;
if (build_user_friendly_ref_for_offset (&t, TREE_TYPE (t), lacc->offset, if (build_user_friendly_ref_for_offset (&t, TREE_TYPE (t), lacc->offset,
racc->type)) racc->type))
lacc->expr = t;
else
{ {
lacc->expr = t; lacc->expr = build_ref_for_model (EXPR_LOCATION (lacc->base),
lacc->type = racc->type; lacc->base, lacc->offset,
racc, NULL, false);
lacc->grp_no_warning = true;
} }
return false; return false;
} }
......
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