aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-stmts.c
diff options
context:
space:
mode:
authorIlya Enkovich <enkovich.gnu@gmail.com>2016-01-25 12:48:54 +0000
committerIlya Enkovich <ienkovich@gcc.gnu.org>2016-01-25 12:48:54 +0000
commit2947d3b29ca4008d6ed4bf53851c04972c56ede1 (patch)
tree5938fade9440c8d2ae287cda71cb73ce387b839a /gcc/tree-vect-stmts.c
parent1cf11fe62a4318f6188b6cd74272ab7311b3b717 (diff)
downloadgcc-2947d3b29ca4008d6ed4bf53851c04972c56ede1.zip
gcc-2947d3b29ca4008d6ed4bf53851c04972c56ede1.tar.gz
gcc-2947d3b29ca4008d6ed4bf53851c04972c56ede1.tar.bz2
re PR target/69421 (ICE in maybe_legitimize_operand, at optabs.c:6888 with -O3)
gcc/ PR target/69421 * tree-vect-stmts.c (vectorizable_condition): Check vectype of operands is compatible with a statement vectype. gcc/testsuite/ PR target/69421 * gcc.dg/pr69421.c: New test. From-SVN: r232792
Diffstat (limited to 'gcc/tree-vect-stmts.c')
-rw-r--r--gcc/tree-vect-stmts.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index c986a00..1dcd129 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -7528,6 +7528,7 @@ vectorizable_condition (gimple *stmt, gimple_stmt_iterator *gsi,
tree vectype = STMT_VINFO_VECTYPE (stmt_info);
int nunits = TYPE_VECTOR_SUBPARTS (vectype);
+ tree vectype1 = NULL_TREE, vectype2 = NULL_TREE;
if (slp_node || PURE_SLP_STMT (stmt_info))
ncopies = 1;
@@ -7547,9 +7548,17 @@ vectorizable_condition (gimple *stmt, gimple_stmt_iterator *gsi,
return false;
gimple *def_stmt;
- if (!vect_is_simple_use (then_clause, stmt_info->vinfo, &def_stmt, &dt))
+ if (!vect_is_simple_use (then_clause, stmt_info->vinfo, &def_stmt, &dt,
+ &vectype1))
+ return false;
+ if (!vect_is_simple_use (else_clause, stmt_info->vinfo, &def_stmt, &dt,
+ &vectype2))
return false;
- if (!vect_is_simple_use (else_clause, stmt_info->vinfo, &def_stmt, &dt))
+
+ if (vectype1 && !useless_type_conversion_p (vectype, vectype1))
+ return false;
+
+ if (vectype2 && !useless_type_conversion_p (vectype, vectype2))
return false;
masked = !COMPARISON_CLASS_P (cond_expr);