2007-06-25 Andrew Pinski <andrew_pinski@playstation.sony.com>
authorpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 26 Jun 2007 00:19:44 +0000 (00:19 +0000)
committerpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 26 Jun 2007 00:19:44 +0000 (00:19 +0000)
        PR tree-opt/32421
        * tree-vect-transform.c (vectorizable_operation): Convert
        POINTER_PLUS_EXPR over to PLUS_EXPR.

2007-06-25  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR tree-opt/32421
        * gcc.dg/vect/pr32421.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126012 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/pr32421.c [new file with mode: 0644]
gcc/tree-vect-transform.c

index ed785d5..dcaa66b 100644 (file)
@@ -1,3 +1,9 @@
+2007-06-25  Andrew Pinski  <andrew_pinski@playstation.sony.com>
+
+       PR tree-opt/32421
+       * tree-vect-transform.c (vectorizable_operation): Convert
+       POINTER_PLUS_EXPR over to PLUS_EXPR.
+
 2007-06-25  Chao-ying Fu  <fu@mips.com>
 
        * doc/rtl.texi (Machine Modes): Document QQ, HQ, SQ, DQ, TQ,
index 1621e7c..8cd2521 100644 (file)
@@ -1,3 +1,8 @@
+2007-06-25  Andrew Pinski  <andrew_pinski@playstation.sony.com>
+
+       PR tree-opt/32421
+       * gcc.dg/vect/pr32421.c: New test.
+
 2006-06-26  Simon Martin  <simartin@users.sourceforge.net>
 
        PR c++/32111
diff --git a/gcc/testsuite/gcc.dg/vect/pr32421.c b/gcc/testsuite/gcc.dg/vect/pr32421.c
new file mode 100644 (file)
index 0000000..68d51bd
--- /dev/null
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+
+
+int f(int **__restrict a, int ** __restrict b)
+{
+  int i;
+  for(i= 0;i<32;i++)
+    a[i] = b[i] + 1;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
index d9152f9..66228f0 100644 (file)
@@ -2968,6 +2968,12 @@ vectorizable_operation (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt)
 
   operation = GIMPLE_STMT_OPERAND (stmt, 1);
   code = TREE_CODE (operation);
+
+  /* For pointer addition, we should use the normal plus for
+     the vector addition.  */
+  if (code == POINTER_PLUS_EXPR)
+    code = PLUS_EXPR;
+
   optab = optab_for_tree_code (code, vectype);
 
   /* Support only unary or binary operations.  */