summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/vect
diff options
context:
space:
mode:
authordorit <dorit@138bc75d-0d04-0410-961f-82ee72b054a4>2007-02-19 08:46:45 +0000
committerdorit <dorit@138bc75d-0d04-0410-961f-82ee72b054a4>2007-02-19 08:46:45 +0000
commit435c10320330151f08321bbbc821a4084cfb7c72 (patch)
tree5db2d0b024834594c5a831e83a077e055f02ce2d /gcc/testsuite/gcc.dg/vect
parentec72623f7c8d0a87c87160c3c07e0f607c589b1c (diff)
downloadgcc-435c10320330151f08321bbbc821a4084cfb7c72.tar.gz
PR tree-optimization/30975
* tree-vect-trasnform.c (vect_get_vec_def_for_stmt_copy): Remove wrong assert. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122127 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/vect')
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr30795.c19
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-iv-8.c10
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-iv-8a.c43
3 files changed, 70 insertions, 2 deletions
diff --git a/gcc/testsuite/gcc.dg/vect/pr30795.c b/gcc/testsuite/gcc.dg/vect/pr30795.c
new file mode 100644
index 00000000000..53dc9fa51f3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/pr30795.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+char bigDone[260];
+int runningOrder[260];
+
+int
+main()
+{
+ int i;
+ for (i = 0; i <= 255; i++) {
+ bigDone [i] = ((char)0);
+ runningOrder[i] = i;
+ }
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-iv-8.c b/gcc/testsuite/gcc.dg/vect/vect-iv-8.c
index a2d4e375299..f8626a1a58f 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-iv-8.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-iv-8.c
@@ -10,6 +10,7 @@ int main1 (short X)
unsigned char a[N];
unsigned short b[N];
unsigned int c[N];
+ short myX = X;
int i;
/* vectorization of induction with type conversions. */
@@ -18,12 +19,13 @@ int main1 (short X)
a[i] = (unsigned char)X;
b[i] = X;
c[i] = (unsigned int)X;
+ X++;
}
/* check results: */
for (i = 0; i < N; i++)
{
- if (a[i] != (char)X || b[i] != X || c[i] != (int)X)
+ if (a[i] != (unsigned char)myX || b[i] != myX || c[i] != (unsigned int)myX++)
abort ();
}
@@ -37,5 +39,9 @@ int main (void)
return main1 (3);
}
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_pack_mod && vect_unpack } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */
+/* Fails to get vectorized due to a redundant cast. Once this is fixed,
+ should be vectorized as follows:
+ dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_pack_mod && vect_unpack } } }
+*/
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-iv-8a.c b/gcc/testsuite/gcc.dg/vect/vect-iv-8a.c
new file mode 100644
index 00000000000..ac6bde7210c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-iv-8a.c
@@ -0,0 +1,43 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 26
+
+int main1 (short X)
+{
+ signed char a[N];
+ short b[N];
+ int c[N];
+ short myX = X;
+ int i;
+
+ /* vectorization of induction with type conversions. */
+ for (i = 0; i < N; i++)
+ {
+ a[i] = (signed char)X;
+ b[i] = X;
+ c[i] = (int)X;
+ X++;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (a[i] != (signed char)myX || b[i] != myX || c[i] != (int)myX++)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 (3);
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_pack_mod && vect_unpack } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */