re PR tree-optimization/51583 (One more missing force_gimple_operand in SRA)

2011-12-19  Martin Jambor  <mjambor@suse.cz>

	PR tree-optimization/51583
	* tree-sra.c (load_assign_lhs_subreplacements): Call
	force_gimple_operand_gsi when necessary also in case of no
	corresponding replacement on the RHS.

	* testsuite/gcc.dg/tree-ssa/pr51583.c: New test.

From-SVN: r182483
This commit is contained in:
Martin Jambor 2011-12-19 15:33:18 +01:00 committed by Martin Jambor
parent a1a6c5b26a
commit 6a9ceb1703
4 changed files with 49 additions and 0 deletions

View File

@ -1,3 +1,10 @@
2011-12-19 Martin Jambor <mjambor@suse.cz>
PR tree-optimization/51583
* tree-sra.c (load_assign_lhs_subreplacements): Call
force_gimple_operand_gsi when necessary also in case of no
corresponding replacement on the RHS.
2011-12-19 Jakub Jelinek <jakub@redhat.com>
* gimple.h (gimplify_seq_add_stmt): Rename to...

View File

@ -1,3 +1,8 @@
2011-12-19 Martin Jambor <mjambor@suse.cz>
PR tree-optimization/51583
* gcc.dg/tree-ssa/pr51583.c: New test.
2011-12-19 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/51596

View File

@ -0,0 +1,34 @@
/* { dg-do compile } */
/* { dg-options "-O1" } */
typedef __complex__ double Value;
union U
{
Value v;
char c[sizeof(Value)];
};
struct S
{
union U u;
int i,j;
};
Value gv;
int gi, gj;
Value foo (void)
{
struct S s,t;
t.i = gi;
t.j = gj;
t.u.v = gv;
t.u.c[0] = 0;
s = t;
__imag__ s.u.v += s.i;
return s.u.v;
}

View File

@ -2752,6 +2752,9 @@ load_assign_lhs_subreplacements (struct access *lacc, struct access *top_racc,
else
rhs = build_ref_for_model (loc, top_racc->base, offset, lacc,
new_gsi, true);
if (lacc->grp_partial_lhs)
rhs = force_gimple_operand_gsi (new_gsi, rhs, true, NULL_TREE,
false, GSI_NEW_STMT);
}
stmt = gimple_build_assign (get_access_replacement (lacc), rhs);