tree-loop-distribution.c (tree_loop_distribution): Make sure to distribute all stores.

2013-11-15  Richard Biener  <rguenther@suse.de>

	* tree-loop-distribution.c (tree_loop_distribution): Make sure
	to distribute all stores.

	* gcc.dg/torture/20131115-1.c: New testcase.

From-SVN: r204843
This commit is contained in:
Richard Biener 2013-11-15 14:43:52 +00:00 committed by Richard Biener
parent 335123032e
commit e179190c03
4 changed files with 48 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2013-11-15 Richard Biener <rguenther@suse.de>
* tree-loop-distribution.c (tree_loop_distribution): Make sure
to distribute all stores.
2013-11-15 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
* doc/invoke.texi (-mabi=elfv1, -mabi=elfv2): Document.

View File

@ -1,3 +1,7 @@
2013-11-15 Richard Biener <rguenther@suse.de>
* gcc.dg/torture/20131115-1.c: New testcase.
2013-11-15 Joseph Myers <joseph@codesourcery.com>
* gcc.dg/cpp/ucnid-9.c: New test.

View File

@ -0,0 +1,38 @@
/* { dg-do run } */
struct S { int i; };
__attribute__((const, noinline, noclone))
struct S foo (int x)
{
struct S s;
s.i = x;
return s;
}
int a[2048], b[2048], c[2048], d[2048];
struct S e[2048];
__attribute__((noinline, noclone)) void
bar (void)
{
int i;
for (i = 0; i < 1024; i++)
{
e[i] = foo (i);
a[i+2] = a[i] + a[i+1];
b[10] = b[10] + i;
c[i] = c[2047 - i];
d[i] = d[i + 1];
}
}
int
main ()
{
int i;
bar ();
for (i = 0; i < 1024; i++)
if (e[i].i != i)
__builtin_abort ();
return 0;
}

View File

@ -1724,8 +1724,7 @@ tree_loop_distribution (void)
if (stmt_has_scalar_dependences_outside_loop (loop, stmt))
;
/* Otherwise only distribute stores for now. */
else if (!gimple_assign_single_p (stmt)
|| is_gimple_reg (gimple_assign_lhs (stmt)))
else if (!gimple_vdef (stmt))
continue;
work_list.safe_push (stmt);