summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-15 14:43:52 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-15 14:43:52 +0000
commit740b4ee736e7ea0cb54e2f0b979cd63f53d4859c (patch)
treebf5cf4e1ba69dad64f9c8ad425d4434703d23cd7
parentea8a42cce3d765a8f6c53dc3fa6ec17aac761d7a (diff)
downloadgcc-740b4ee736e7ea0cb54e2f0b979cd63f53d4859c.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204843 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.dg/torture/20131115-1.c38
-rw-r--r--gcc/tree-loop-distribution.c3
4 files changed, 48 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5ca6e38e0f7..576d5f7d681 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d395e736da3..ddfc46a9aa6 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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.
diff --git a/gcc/testsuite/gcc.dg/torture/20131115-1.c b/gcc/testsuite/gcc.dg/torture/20131115-1.c
new file mode 100644
index 00000000000..edb05f04c47
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/20131115-1.c
@@ -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;
+}
diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c
index 331af04b5fe..075487726f4 100644
--- a/gcc/tree-loop-distribution.c
+++ b/gcc/tree-loop-distribution.c
@@ -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);