aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-loop.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@gcc.gnu.org>2017-02-06 20:15:36 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2017-02-06 20:15:36 +0100
commit2568d8a1f6d3912e53c457a1ea080050a834cf32 (patch)
tree5df5458d496ad1f8120100b5ff671033e10219d5 /gcc/tree-vect-loop.c
parentaae936b9a3914cf4b5d532644fbdcb1bf70f8099 (diff)
downloadgcc-2568d8a1f6d3912e53c457a1ea080050a834cf32.zip
gcc-2568d8a1f6d3912e53c457a1ea080050a834cf32.tar.gz
gcc-2568d8a1f6d3912e53c457a1ea080050a834cf32.tar.bz2
re PR tree-optimization/79284 (ICE on valid code at -O3 on x86_64-linux-gnu: verify_gimple failed)
PR tree-optimization/79284 * tree-vectorizer.h (VECT_SCALAR_BOOLEAN_TYPE_P): Define. * tree-vect-stmts.c (vect_get_vec_def_for_operand, vectorizable_mask_load_store, vectorizable_operation, vect_is_simple_cond, get_same_sized_vectype): Use it instead of comparing TREE_CODE of a type against BOOLEAN_TYPE. * tree-vect-patterns.c (check_bool_pattern, search_type_for_mask_1, vect_recog_bool_pattern, vect_recog_mask_conversion_pattern): Likewise. * tree-vect-slp.c (vect_get_constant_vectors): Likewise. * tree-vect-loop.c (vect_determine_vectorization_factor): Likewise. Remove redundant gimple_code (stmt) == GIMPLE_ASSIGN test after is_gimple_assign (stmt). Replace another such test with is_gimple_assign (stmt). testsuite/ * gcc.c-torture/compile/pr79284.c: New test. From-SVN: r245214
Diffstat (limited to 'gcc/tree-vect-loop.c')
-rw-r--r--gcc/tree-vect-loop.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index f9b3f54..c5a1627 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -433,7 +433,7 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
/* Bool ops don't participate in vectorization factor
computation. For comparison use compared types to
compute a factor. */
- if (TREE_CODE (scalar_type) == BOOLEAN_TYPE
+ if (VECT_SCALAR_BOOLEAN_TYPE_P (scalar_type)
&& is_gimple_assign (stmt)
&& gimple_assign_rhs_code (stmt) != COND_EXPR)
{
@@ -442,11 +442,10 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
mask_producers.safe_push (stmt_info);
bool_result = true;
- if (gimple_code (stmt) == GIMPLE_ASSIGN
- && TREE_CODE_CLASS (gimple_assign_rhs_code (stmt))
- == tcc_comparison
- && TREE_CODE (TREE_TYPE (gimple_assign_rhs1 (stmt)))
- != BOOLEAN_TYPE)
+ if (TREE_CODE_CLASS (gimple_assign_rhs_code (stmt))
+ == tcc_comparison
+ && !VECT_SCALAR_BOOLEAN_TYPE_P
+ (TREE_TYPE (gimple_assign_rhs1 (stmt))))
scalar_type = TREE_TYPE (gimple_assign_rhs1 (stmt));
else
{
@@ -585,9 +584,10 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
stmt = STMT_VINFO_STMT (mask_producers[i]);
- if (gimple_code (stmt) == GIMPLE_ASSIGN
+ if (is_gimple_assign (stmt)
&& TREE_CODE_CLASS (gimple_assign_rhs_code (stmt)) == tcc_comparison
- && TREE_CODE (TREE_TYPE (gimple_assign_rhs1 (stmt))) != BOOLEAN_TYPE)
+ && !VECT_SCALAR_BOOLEAN_TYPE_P
+ (TREE_TYPE (gimple_assign_rhs1 (stmt))))
{
scalar_type = TREE_TYPE (gimple_assign_rhs1 (stmt));
mask_type = get_mask_type_for_scalar_type (scalar_type);