aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIra Rosen <irar@il.ibm.com>2010-08-18 09:48:59 +0000
committerIra Rosen <irar@il.ibm.com>2010-08-18 09:48:59 +0000
commitf09c1f0abbf5556eff4bbb27a157a7733e32e2c9 (patch)
tree61709f4e08241e099222b9cfb63a0097543881c3
parentcb9200f7307f8f9d50bab58a384ed4e83d27f158 (diff)
Fix type checking vectorizable_assignment.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/st/cli-be-vect@163331 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/tree-vect-transform.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/tree-vect-transform.c b/gcc/tree-vect-transform.c
index 40425d43e02..f31b292aa18 100644
--- a/gcc/tree-vect-transform.c
+++ b/gcc/tree-vect-transform.c
@@ -4340,7 +4340,7 @@ vectorizable_assignment (gimple stmt, gimple_stmt_iterator *gsi,
tree scalar_dest;
tree op;
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
- tree vectype = STMT_VINFO_VECTYPE (stmt_info), vectype_in;
+ tree vectype = STMT_VINFO_VECTYPE (stmt_info), vectype_in, vectype_out;
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
tree new_temp;
tree def;
@@ -4397,10 +4397,14 @@ vectorizable_assignment (gimple stmt, gimple_stmt_iterator *gsi,
/* We can handle NOP_EXPR conversions that do not change the number
of elements or the vector size. */
vectype_in = get_vectype_for_scalar_type (TREE_TYPE (op));
+ vectype_out = get_vectype_for_scalar_type (TREE_TYPE (scalar_dest));
+
if (CONVERT_EXPR_CODE_P (code)
&& (!vectype_in
|| TYPE_VECTOR_SUBPARTS (vectype_in) != (unsigned) nunits
- || (GET_MODE_SIZE (TYPE_MODE (vectype))
+ || TYPE_VECTOR_SUBPARTS (vectype_in)
+ != TYPE_VECTOR_SUBPARTS (vectype_out)
+ || (GET_MODE_SIZE (TYPE_MODE (vectype_out))
!= GET_MODE_SIZE (TYPE_MODE (vectype_in)))))
return false;