aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorIra Rosen <irar@il.ibm.com>2010-06-14 12:22:13 +0000
committerIra Rosen <irar@gcc.gnu.org>2010-06-14 12:22:13 +0000
commitc1e822d590c3841514118cc79284e466ac31125f (patch)
treeb0fa78dca1bcc6286458dff5972922cd0cf8557e /gcc/testsuite
parent66919db5ac195aa7fe24af68c8f75222c952145e (diff)
downloadgcc-c1e822d590c3841514118cc79284e466ac31125f.zip
gcc-c1e822d590c3841514118cc79284e466ac31125f.tar.gz
gcc-c1e822d590c3841514118cc79284e466ac31125f.tar.bz2
re PR tree-optimization/44507 (vectorization ANDs array elements together incorrectly)
PR tree-optimization/44507 * tree-vect-loop.c (get_initial_def_for_reduction): Use -1 to build initial vector for BIT_AND_EXPR. * tree-vect-slp.c (vect_get_constant_vectors): Likewise. From-SVN: r160727
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr44507.c55
2 files changed, 60 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 7f63eed..2dadf09 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2010-06-14 Ira Rosen <irar@il.ibm.com>
+
+ PR tree-optimization/44507
+ * gcc.dg/vect/pr44507.c: New test.
+
2010-06-13 H.J. Lu <hongjiu.lu@intel.com>
* g++.dg/plugin/header_plugin.c: Add "c-family/" to c-common.h
diff --git a/gcc/testsuite/gcc.dg/vect/pr44507.c b/gcc/testsuite/gcc.dg/vect/pr44507.c
new file mode 100644
index 0000000..e53ba30
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/pr44507.c
@@ -0,0 +1,55 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdlib.h>
+#include "tree-vect.h"
+
+int seeIf256ByteArrayIsConstant(
+ unsigned char *pArray)
+{
+ int index;
+ unsigned int curVal, orVal, andVal;
+ int bytesAreEqual = 0;
+
+ if (pArray != 0)
+ {
+ for (index = 0, orVal = 0, andVal = 0xFFFFFFFF;
+ index < 64;
+ index += (int)sizeof(unsigned int))
+ {
+ curVal = *((unsigned long *)(&pArray[index]));
+ orVal = orVal | curVal;
+ andVal = andVal & curVal;
+ }
+
+ if (!((orVal == andVal)
+ && ((orVal >> 8) == (andVal & 0x00FFFFFF))))
+ abort ();
+ }
+
+ return 0;
+}
+
+
+int main(int argc, char** argv)
+{
+ unsigned char array1[64] = {
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ };
+
+ argv = argv;
+ argc = argc;
+
+ check_vect ();
+
+ return seeIf256ByteArrayIsConstant(&array1[0]);
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
+