aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-stmts.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2016-05-25 10:57:53 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2016-05-25 10:57:53 +0000
commite412ece4ce3a815d22cb408a2467d4e3b835f9a3 (patch)
treee1cf9f7417a6ea712fde8c6cf87e9c854929d983 /gcc/tree-vect-stmts.c
parentb9e551ad26b6cd4d577bf083c87e638fd83ee6fa (diff)
downloadgcc-e412ece4ce3a815d22cb408a2467d4e3b835f9a3.zip
gcc-e412ece4ce3a815d22cb408a2467d4e3b835f9a3.tar.gz
gcc-e412ece4ce3a815d22cb408a2467d4e3b835f9a3.tar.bz2
re PR tree-optimization/71264 (ICE in convert_move)
2016-05-25 Richard Biener <rguenther@suse.de> PR tree-optimization/71264 * tree-vect-stmts.c (vect_init_vector): Properly deal with vector type val. * gcc.dg/vect/pr71264.c: New testcase. From-SVN: r236699
Diffstat (limited to 'gcc/tree-vect-stmts.c')
-rw-r--r--gcc/tree-vect-stmts.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index f11f22e..d2e16d0 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -1256,10 +1256,11 @@ vect_init_vector (gimple *stmt, tree val, tree type, gimple_stmt_iterator *gsi)
gimple *init_stmt;
tree new_temp;
- if (TREE_CODE (type) == VECTOR_TYPE
- && TREE_CODE (TREE_TYPE (val)) != VECTOR_TYPE)
+ /* We abuse this function to push sth to a SSA name with initial 'val'. */
+ if (! useless_type_conversion_p (type, TREE_TYPE (val)))
{
- if (!types_compatible_p (TREE_TYPE (type), TREE_TYPE (val)))
+ gcc_assert (TREE_CODE (type) == VECTOR_TYPE);
+ if (! types_compatible_p (TREE_TYPE (type), TREE_TYPE (val)))
{
/* Scalar boolean value should be transformed into
all zeros or all ones value before building a vector. */
@@ -1284,7 +1285,13 @@ vect_init_vector (gimple *stmt, tree val, tree type, gimple_stmt_iterator *gsi)
else
{
new_temp = make_ssa_name (TREE_TYPE (type));
- init_stmt = gimple_build_assign (new_temp, NOP_EXPR, val);
+ if (! INTEGRAL_TYPE_P (TREE_TYPE (val)))
+ init_stmt = gimple_build_assign (new_temp,
+ fold_build1 (VIEW_CONVERT_EXPR,
+ TREE_TYPE (type),
+ val));
+ else
+ init_stmt = gimple_build_assign (new_temp, NOP_EXPR, val);
vect_init_vector_1 (stmt, init_stmt, gsi);
val = new_temp;
}