This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[committed] Add testcase for already fixed PR tree-optimization/87320
- From: Jakub Jelinek <jakub at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 5 Dec 2018 00:29:18 +0100
- Subject: [committed] Add testcase for already fixed PR tree-optimization/87320
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
I've committed the following testcase for already fixed PR, which has been
fixed by the PR87288 fix, after testing on x86_64-linux and i686-linux.
2018-12-04 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/87320
* gcc.dg/pr87320.c: New test.
--- gcc/testsuite/gcc.dg/pr87320.c.jj 2018-12-04 19:16:45.370455885 +0100
+++ gcc/testsuite/gcc.dg/pr87320.c 2018-12-04 19:16:38.428568535 +0100
@@ -0,0 +1,28 @@
+/* PR tree-optimization/87320 */
+/* { dg-do run } */
+/* { dg-options "-O3" } */
+/* { dg-additional-options "-mavx" { target avx_runtime } } */
+
+static void __attribute__ ((noinline))
+transpose_vector (unsigned long n)
+{
+ unsigned long data[2 * n];
+ for (unsigned long i = 0; i < 2 * n; i++)
+ data[i] = 4 * i + 2;
+
+ unsigned long transposed[n];
+ for (unsigned long i = 0; i < n; i++)
+ transposed[i] = data[2 * i];
+
+ for (unsigned long i = 0; i < n; i++)
+ if (transposed[i] != 8 * i + 2)
+ __builtin_abort ();
+}
+
+int
+main ()
+{
+ transpose_vector (4);
+ transpose_vector (120);
+ return 0;
+}
Jakub