aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-stmts.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2018-06-13 15:03:50 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2018-06-13 15:03:50 +0000
commit7b76867b211f2db8df2f98926ef47fb8c9ea29ee (patch)
tree10d8bb5c2d3fbea3cbe89fee0946176b7989804f /gcc/tree-vect-stmts.c
parent92877928f020d69de397e600052ceb1c9d22c5e8 (diff)
downloadgcc-7b76867b211f2db8df2f98926ef47fb8c9ea29ee.zip
gcc-7b76867b211f2db8df2f98926ef47fb8c9ea29ee.tar.gz
gcc-7b76867b211f2db8df2f98926ef47fb8c9ea29ee.tar.bz2
tree-vect-patterns.c (vect_recog_vector_vector_shift_pattern): Properly set vector type of the intermediate stmt.
2018-06-13 Richard Biener <rguenther@suse.de> * tree-vect-patterns.c (vect_recog_vector_vector_shift_pattern): Properly set vector type of the intermediate stmt. * tree-vect-stmts.c (vectorizable_operation): The destination var always has vectype_out type. From-SVN: r261553
Diffstat (limited to 'gcc/tree-vect-stmts.c')
-rw-r--r--gcc/tree-vect-stmts.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index da4cb07..9f365e3 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -5981,16 +5981,19 @@ vectorizable_operation (gimple *stmt, gimple_stmt_iterator *gsi,
dump_printf_loc (MSG_NOTE, vect_location,
"transform binary/unary operation.\n");
- /* Handle def. */
- vec_dest = vect_create_destination_var (scalar_dest, vectype);
-
/* POINTER_DIFF_EXPR has pointer arguments which are vectorized as
vectors with unsigned elements, but the result is signed. So, we
need to compute the MINUS_EXPR into vectype temporary and
VIEW_CONVERT_EXPR it into the final vectype_out result. */
tree vec_cvt_dest = NULL_TREE;
if (orig_code == POINTER_DIFF_EXPR)
- vec_cvt_dest = vect_create_destination_var (scalar_dest, vectype_out);
+ {
+ vec_dest = vect_create_destination_var (scalar_dest, vectype);
+ vec_cvt_dest = vect_create_destination_var (scalar_dest, vectype_out);
+ }
+ /* Handle def. */
+ else
+ vec_dest = vect_create_destination_var (scalar_dest, vectype_out);
/* In case the vectorization factor (VF) is bigger than the number
of elements that we can fit in a vectype (nunits), we have to generate