This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[COMMITTED, PR 50628] More careful SRA sub-access propagation accross assignments
- From: Martin Jambor <mjambor at suse dot cz>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 13 Dec 2011 17:13:42 +0100
- Subject: [COMMITTED, PR 50628] More careful SRA sub-access propagation accross assignments
Hi,
Richi approved the following patch to fix 50628 on IRC. Details about
the problem and this particular patch are also in bugzilla. Of
course, I bootstrapped and tested the patch today on x86_64-linux.
Thanks,
Martin
2011-12-13 Martin Jambor <mjambor@suse.cz>
PR middle-end/50628
* tree-sra.c (propagate_subaccesses_across_link): Do not propagate
sub-accesses of scalar accesses.
Index: src/gcc/tree-sra.c
===================================================================
--- src.orig/gcc/tree-sra.c
+++ src/gcc/tree-sra.c
@@ -2234,21 +2234,23 @@ propagate_subaccesses_across_link (struc
|| racc->grp_unscalarizable_region)
return false;
- if (!lacc->first_child && !racc->first_child
- && is_gimple_reg_type (racc->type))
+ if (is_gimple_reg_type (racc->type))
{
- tree t = lacc->base;
-
- lacc->type = racc->type;
- if (build_user_friendly_ref_for_offset (&t, TREE_TYPE (t), lacc->offset,
- racc->type))
- lacc->expr = t;
- else
+ if (!lacc->first_child && !racc->first_child)
{
- lacc->expr = build_ref_for_model (EXPR_LOCATION (lacc->base),
- lacc->base, lacc->offset,
- racc, NULL, false);
- lacc->grp_no_warning = true;
+ tree t = lacc->base;
+
+ lacc->type = racc->type;
+ if (build_user_friendly_ref_for_offset (&t, TREE_TYPE (t),
+ lacc->offset, racc->type))
+ lacc->expr = t;
+ else
+ {
+ lacc->expr = build_ref_for_model (EXPR_LOCATION (lacc->base),
+ lacc->base, lacc->offset,
+ racc, NULL, false);
+ lacc->grp_no_warning = true;
+ }
}
return false;
}