aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite
diff options
context:
space:
mode:
authorRong Xu <xur@google.com>2014-10-31 12:00:28 -0700
committerRong Xu <xur@google.com>2014-10-31 12:00:28 -0700
commit29098ff058814235fb39d00b7496b7f8345ed3eb (patch)
treef0aaf66f503399133223096679a60c1217a45391 /gcc-4.9/gcc/testsuite
parente86367917b8400cc955d8bba75dcc329cb0e75d0 (diff)
downloadtoolchain_gcc-29098ff058814235fb39d00b7496b7f8345ed3eb.tar.gz
toolchain_gcc-29098ff058814235fb39d00b7496b7f8345ed3eb.tar.bz2
toolchain_gcc-29098ff058814235fb39d00b7496b7f8345ed3eb.zip
[4.9] Backport patches fixed vectorization issues.
Backport 3 patches from upstream gcc that fixed some vectorization issues: r215585 fixed PR63341 r216508 fixed PR63563 r216770 fixed PR63530 Change-Id: I650bf25ef0843b1ff01911b567fb26e069fd4550
Diffstat (limited to 'gcc-4.9/gcc/testsuite')
-rw-r--r--gcc-4.9/gcc/testsuite/ChangeLog16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr63341-1.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr63341-2.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr63530.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/i386/pr63563.c17
5 files changed, 130 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/ChangeLog b/gcc-4.9/gcc/testsuite/ChangeLog
index 51626c35e..2200c1267 100644
--- a/gcc-4.9/gcc/testsuite/ChangeLog
+++ b/gcc-4.9/gcc/testsuite/ChangeLog
@@ -1,3 +1,19 @@
+2014-10-27 Guozhi Wei <carrot@google.com>
+
+ PR tree-optimization/63530
+ gcc.dg/vect/pr63530.c: New test.
+
+2014-10-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/63563
+ * gcc.target/i386/pr63563.c: New test.
+
+2014-09-25 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/63341
+ * gcc.dg/vect/pr63341-1.c: New test.
+ * gcc.dg/vect/pr63341-2.c: New test.
+
2014-09-04 Guozhi Wei <carrot@google.com>
PR target/62040
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr63341-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr63341-1.c
new file mode 100644
index 000000000..4aece7bbd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr63341-1.c
@@ -0,0 +1,32 @@
+/* PR tree-optimization/63341 */
+/* { dg-do run } */
+
+#include "tree-vect.h"
+
+typedef union U { unsigned short s; unsigned char c; } __attribute__((packed)) U;
+struct S { char e __attribute__((aligned (64))); U s[32]; };
+struct S t = {0, {{1}, {2}, {3}, {4}, {5}, {6}, {7}, {8},
+ {9}, {10}, {11}, {12}, {13}, {14}, {15}, {16},
+ {17}, {18}, {19}, {20}, {21}, {22}, {23}, {24},
+ {25}, {26}, {27}, {28}, {29}, {30}, {31}, {32}}};
+unsigned short d[32] = { 1 };
+
+__attribute__((noinline, noclone)) void
+foo ()
+{
+ int i;
+ for (i = 0; i < 32; i++)
+ d[i] = t.s[i].s;
+ if (__builtin_memcmp (d, t.s, sizeof d))
+ abort ();
+}
+
+int
+main ()
+{
+ check_vect ();
+ foo ();
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr63341-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr63341-2.c
new file mode 100644
index 000000000..4e7d2bb1f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr63341-2.c
@@ -0,0 +1,35 @@
+/* PR tree-optimization/63341 */
+/* { dg-do run } */
+
+#include "tree-vect.h"
+
+typedef union U { unsigned short s; unsigned char c; } __attribute__((packed)) U;
+struct S { char e __attribute__((aligned (64))); U s[32]; };
+struct S t = {0, {{0x5010}, {0x5111}, {0x5212}, {0x5313}, {0x5414}, {0x5515}, {0x5616}, {0x5717},
+ {0x5818}, {0x5919}, {0x5a1a}, {0x5b1b}, {0x5c1c}, {0x5d1d}, {0x5e1e}, {0x5f1f},
+ {0x6020}, {0x6121}, {0x6222}, {0x6323}, {0x6424}, {0x6525}, {0x6626}, {0x6727},
+ {0x6828}, {0x6929}, {0x6a2a}, {0x6b2b}, {0x6c2c}, {0x6d2d}, {0x6e2e}, {0x6f2f}}};
+unsigned short d[32] = { 1 };
+
+__attribute__((noinline, noclone)) void
+foo ()
+{
+ int i;
+ for (i = 0; i < 32; i++)
+ d[i] = t.s[i].s + 4;
+ for (i = 0; i < 32; i++)
+ if (d[i] != t.s[i].s + 4)
+ abort ();
+ else
+ asm volatile ("" : : : "memory");
+}
+
+int
+main ()
+{
+ check_vect ();
+ foo ();
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr63530.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr63530.c
new file mode 100644
index 000000000..b583b9b35
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr63530.c
@@ -0,0 +1,30 @@
+/* { dg-options "-O2 -ftree-vectorize -funroll-loops --param \"max-completely-peeled-insns=400\"" } */
+
+/* PR tree-optimization/63530 */
+/* On armv7 hardware, following options cause run time failure */
+/* -march=armv7-a -mfloat-abi=hard -mfpu=neon -marm -O2 -ftree-vectorize */
+/* -funroll-loops --param "max-completely-peeled-insns=400" */
+
+#include <stdlib.h>
+
+typedef struct {
+ unsigned char map[256];
+ int i;
+} A, *AP;
+
+AP __attribute__ ((noinline))
+foo (int n)
+{
+ AP b = (AP)calloc (1, sizeof (A));
+ int i;
+ for (i = n; i < 256; i++)
+ b->map[i] = i;
+ return b;
+}
+
+int
+main()
+{
+ AP p = foo(3);
+ return p->map[30] - p->map[20] - p->map[10];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/pr63563.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/pr63563.c
new file mode 100644
index 000000000..ce3e4658e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/pr63563.c
@@ -0,0 +1,17 @@
+/* PR tree-optimization/63563 */
+/* { dg-do compile } */
+/* { dg-options "-O3 -mavx2" } */
+
+struct A { unsigned long a, b, c, d; } a[1024] = { { 0, 1, 2, 3 } }, b;
+
+void
+foo (void)
+{
+ int i;
+ for (i = 0; i < 1024; i++)
+ {
+ a[i].a = a[i].b = a[i].c = b.c;
+ if (a[i].d)
+ a[i].d = b.d;
+ }
+}