diff options
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/pr32421.c | 12 | ||||
-rw-r--r-- | gcc/tree-vect-transform.c | 6 |
4 files changed, 29 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ed785d5..dcaa66b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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, diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1621e7c..8cd2521 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 index 0000000..68d51bd --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr32421.c @@ -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" } } */ + diff --git a/gcc/tree-vect-transform.c b/gcc/tree-vect-transform.c index d9152f9..66228f0 100644 --- a/gcc/tree-vect-transform.c +++ b/gcc/tree-vect-transform.c @@ -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. */ |