diff options
author | Ilya Enkovich <enkovich.gnu@gmail.com> | 2016-01-20 12:37:01 +0000 |
---|---|---|
committer | Ilya Enkovich <ienkovich@gcc.gnu.org> | 2016-01-20 12:37:01 +0000 |
commit | 28b33016534ba4727d25c2aad5c8a78aeecd2b2c (patch) | |
tree | a68f254fe7a39a1b419a5a36176f05ce43b9f097 /gcc/tree-vect-stmts.c | |
parent | eac437bf2c5ec74c7fd4a3e897207e6b7a5eabb2 (diff) | |
download | gcc-28b33016534ba4727d25c2aad5c8a78aeecd2b2c.zip gcc-28b33016534ba4727d25c2aad5c8a78aeecd2b2c.tar.gz gcc-28b33016534ba4727d25c2aad5c8a78aeecd2b2c.tar.bz2 |
re PR tree-optimization/69328 (ice in vect_get_vec_def_for_operand, at tree-vect-stmts.c:1379 with -O3)
gcc/
PR tree-optimization/69328
* tree-vect-stmts.c (vect_is_simple_cond): Check compared
vectors have same number of elements.
(vectorizable_condition): Fix masked version recognition.
gcc/testsuite/
PR tree-optimization/69328
* gcc.dg/pr69328.c: New test.
Co-Authored-By: Richard Biener <rguenther@suse.de>
From-SVN: r232608
Diffstat (limited to 'gcc/tree-vect-stmts.c')
-rw-r--r-- | gcc/tree-vect-stmts.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index 6be3c97d..1d2246d 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -7445,6 +7445,10 @@ vect_is_simple_cond (tree cond, vec_info *vinfo, tree *comp_vectype) && TREE_CODE (rhs) != FIXED_CST) return false; + if (vectype1 && vectype2 + && TYPE_VECTOR_SUBPARTS (vectype1) != TYPE_VECTOR_SUBPARTS (vectype2)) + return false; + *comp_vectype = vectype1 ? vectype1 : vectype2; return true; } @@ -7548,13 +7552,9 @@ vectorizable_condition (gimple *stmt, gimple_stmt_iterator *gsi, if (!vect_is_simple_use (else_clause, stmt_info->vinfo, &def_stmt, &dt)) return false; - if (VECTOR_BOOLEAN_TYPE_P (comp_vectype)) - { - vec_cmp_type = comp_vectype; - masked = true; - } - else - vec_cmp_type = build_same_sized_truth_vector_type (comp_vectype); + masked = !COMPARISON_CLASS_P (cond_expr); + vec_cmp_type = build_same_sized_truth_vector_type (comp_vectype); + if (vec_cmp_type == NULL_TREE) return false; |