diff options
author | Ira Rosen <irar@il.ibm.com> | 2010-01-14 07:49:39 +0000 |
---|---|---|
committer | Ira Rosen <irar@gcc.gnu.org> | 2010-01-14 07:49:39 +0000 |
commit | cd481d83ed240ebbdb706c3e3f3358f46662d4b8 (patch) | |
tree | 8ff230c25c22542be59f55788bc4fbdc8bebcb05 /gcc | |
parent | a7bf45dee541cfa10350a814f5fbf14c5a316a7f (diff) | |
download | gcc-cd481d83ed240ebbdb706c3e3f3358f46662d4b8.zip gcc-cd481d83ed240ebbdb706c3e3f3358f46662d4b8.tar.gz gcc-cd481d83ed240ebbdb706c3e3f3358f46662d4b8.tar.bz2 |
re PR tree-optimization/42709 (error: type mismatch in pointer plus expression)
PR tree-optimization/42709
* tree-vect-slp.c (vect_get_constant_vectors): Use constant's type
as scalar type in creation of constant vector operand.
From-SVN: r155882
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/pr42709.c | 28 | ||||
-rw-r--r-- | gcc/tree-vect-slp.c | 15 |
4 files changed, 44 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 49edf5b..1865878 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2010-01-14 Ira Rosen <irar@il.ibm.com> + + PR tree-optimization/42709 + * tree-vect-slp.c (vect_get_constant_vectors): Use constant's type + as scalar type in creation of constant vector operand. + 2010-01-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> PR testsuite/42414 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ffe006a..faac669 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-01-14 Ira Rosen <irar@il.ibm.com> + + PR tree-optimization/42709 + * gcc.dg/vect/pr42709.c: New test. + 2010-01-14 Paul Thomas <pault@gcc.gnu.org> PR fortran/41478 diff --git a/gcc/testsuite/gcc.dg/vect/pr42709.c b/gcc/testsuite/gcc.dg/vect/pr42709.c new file mode 100644 index 0000000..8ccbfa6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr42709.c @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target vect_int } */ + +#include <stdarg.h> +#include "tree-vect.h" + +#define N 128 + +int *res[N]; + +int +main1 (int *a, int *b, int *c, int *d, int dummy) +{ + int i; + + for (i = 0; i < N/2; i+=4) + { + res[i] = a + 16; + res[i+1] = b + 16; + res[i+2] = c + 16; + res[i+3] = d + 16; + if (dummy == 32) + abort (); + } +} + +/* { dg-final { cleanup-tree-dump "vect" } } */ + diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c index a3be678..bbf2bd3 100644 --- a/gcc/tree-vect-slp.c +++ b/gcc/tree-vect-slp.c @@ -1421,7 +1421,6 @@ vect_get_constant_vectors (slp_tree slp_node, VEC(tree,heap) **vec_oprnds, VEC (gimple, heap) *stmts = SLP_TREE_SCALAR_STMTS (slp_node); gimple stmt = VEC_index (gimple, stmts, 0); stmt_vec_info stmt_vinfo = vinfo_for_stmt (stmt); - tree vectype = STMT_VINFO_VECTYPE (stmt_vinfo); int nunits; tree vec_cst; tree t = NULL_TREE; @@ -1446,16 +1445,12 @@ vect_get_constant_vectors (slp_tree slp_node, VEC(tree,heap) **vec_oprnds, } if (CONSTANT_CLASS_P (op)) - { - vector_type = vectype; - constant_p = true; - } + constant_p = true; else - { - vector_type = get_vectype_for_scalar_type (TREE_TYPE (op)); - gcc_assert (vector_type); - constant_p = false; - } + constant_p = false; + + vector_type = get_vectype_for_scalar_type (TREE_TYPE (op)); + gcc_assert (vector_type); nunits = TYPE_VECTOR_SUBPARTS (vector_type); |