Commit 28151221 by Martin Jambor Committed by Martin Jambor

tree-sra.c (sra_modify_expr): Generate new memory accesses with same alias type…

tree-sra.c (sra_modify_expr): Generate new memory accesses with same alias type as the original statement.

2014-04-28  Martin Jambor  <mjambor@suse.cz>

	* tree-sra.c (sra_modify_expr): Generate new memory accesses with
	same alias type as the original statement.
	(subreplacement_assignment_data): New type.
	(handle_unscalarized_data_in_subtree): New type of parameter,
	generate new memory accesses with same alias type as the original
	statement.
	(load_assign_lhs_subreplacements): Likewise.
	(sra_modify_constructor_assign): Generate new memory accesses with
	same alias type as the original statement.

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

From-SVN: r209868
parent 93582885
2014-04-28 Martin Jambor <mjambor@suse.cz>
* tree-sra.c (sra_modify_expr): Generate new memory accesses with
same alias type as the original statement.
(subreplacement_assignment_data): New type.
(handle_unscalarized_data_in_subtree): New type of parameter,
generate new memory accesses with same alias type as the original
statement.
(load_assign_lhs_subreplacements): Likewise.
(sra_modify_constructor_assign): Generate new memory accesses with
same alias type as the original statement.
2014-04-28 Richard Biener <rguenther@suse.de> 2014-04-28 Richard Biener <rguenther@suse.de>
* tree-pass.h (TODO_verify_il): Define. * tree-pass.h (TODO_verify_il): Define.
......
2014-04-28 Martin Jambor <mjambor@suse.cz>
* gcc.dg/tree-ssa/sra-14.c: New test.
2014-04-28 Richard Biener <rguenther@suse.de> 2014-04-28 Richard Biener <rguenther@suse.de>
PR middle-end/60092 PR middle-end/60092
......
/* { dg-do run } */
/* { dg-options "-O1" } */
struct S
{
int i, j;
};
struct Z
{
struct S d, s;
};
struct S __attribute__ ((noinline, noclone))
get_s (void)
{
struct S s;
s.i = 5;
s.j = 6;
return s;
}
struct S __attribute__ ((noinline, noclone))
get_d (void)
{
struct S d;
d.i = 0;
d.j = 0;
return d;
}
int __attribute__ ((noinline, noclone))
get_c (void)
{
return 1;
}
int __attribute__ ((noinline, noclone))
my_nop (int i)
{
return i;
}
int __attribute__ ((noinline, noclone))
foo (void)
{
struct Z z;
int i, c = get_c ();
z.d = get_d ();
z.s = get_s ();
for (i = 0; i < c; i++)
{
z.s.i = my_nop (z.s.i);
z.s.j = my_nop (z.s.j);
}
return z.s.i + z.s.j;
}
int main (int argc, char *argv[])
{
if (foo () != 11)
__builtin_abort ();
return 0;
}
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