This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[committed] Add testcase for already fixed PR tree-optimization/87320


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]