aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-stmts.c
diff options
context:
space:
mode:
authorIlya Enkovich <enkovich.gnu@gmail.com>2016-03-18 09:36:32 +0000
committerIlya Enkovich <ienkovich@gcc.gnu.org>2016-03-18 09:36:32 +0000
commit5e8d6dff27050ebc334cb17293c69a8f858120ef (patch)
tree42f389cfffa246b157719b2d2902da132808ecac /gcc/tree-vect-stmts.c
parentd0e7e4031976bf938fad5cf8e1357ed218691ab5 (diff)
downloadgcc-5e8d6dff27050ebc334cb17293c69a8f858120ef.zip
gcc-5e8d6dff27050ebc334cb17293c69a8f858120ef.tar.gz
gcc-5e8d6dff27050ebc334cb17293c69a8f858120ef.tar.bz2
re PR tree-optimization/70252 (ICE in vect_get_vec_def_for_stmt_copy with -O3 -march=skylake-avx512.)
gcc/ PR tree-optimization/70252 * tree-vect-stmts.c (supportable_widening_operation): Check resulting boolean vector has a proper number of elements. (supportable_narrowing_operation): Likewise. gcc/testsuite/ PR tree-optimization/70252 * gcc.dg/pr70252.c: New test. From-SVN: r234323
Diffstat (limited to 'gcc/tree-vect-stmts.c')
-rw-r--r--gcc/tree-vect-stmts.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index 06b1ab7..d12c062 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -8940,7 +8940,12 @@ supportable_widening_operation (enum tree_code code, gimple *stmt,
if (insn_data[icode1].operand[0].mode == TYPE_MODE (wide_vectype)
&& insn_data[icode2].operand[0].mode == TYPE_MODE (wide_vectype))
- return true;
+ /* For scalar masks we may have different boolean
+ vector types having the same QImode. Thus we
+ add additional check for elements number. */
+ return (!VECTOR_BOOLEAN_TYPE_P (vectype)
+ || (TYPE_VECTOR_SUBPARTS (vectype) / 2
+ == TYPE_VECTOR_SUBPARTS (wide_vectype)));
/* Check if it's a multi-step conversion that can be done using intermediate
types. */
@@ -8991,7 +8996,9 @@ supportable_widening_operation (enum tree_code code, gimple *stmt,
if (insn_data[icode1].operand[0].mode == TYPE_MODE (wide_vectype)
&& insn_data[icode2].operand[0].mode == TYPE_MODE (wide_vectype))
- return true;
+ return (!VECTOR_BOOLEAN_TYPE_P (vectype)
+ || (TYPE_VECTOR_SUBPARTS (intermediate_type) / 2
+ == TYPE_VECTOR_SUBPARTS (wide_vectype)));
prev_type = intermediate_type;
prev_mode = intermediate_mode;
@@ -9075,7 +9082,12 @@ supportable_narrowing_operation (enum tree_code code,
*code1 = c1;
if (insn_data[icode1].operand[0].mode == TYPE_MODE (narrow_vectype))
- return true;
+ /* For scalar masks we may have different boolean
+ vector types having the same QImode. Thus we
+ add additional check for elements number. */
+ return (!VECTOR_BOOLEAN_TYPE_P (vectype)
+ || (TYPE_VECTOR_SUBPARTS (vectype) * 2
+ == TYPE_VECTOR_SUBPARTS (narrow_vectype)));
/* Check if it's a multi-step conversion that can be done using intermediate
types. */
@@ -9140,7 +9152,9 @@ supportable_narrowing_operation (enum tree_code code,
(*multi_step_cvt)++;
if (insn_data[icode1].operand[0].mode == TYPE_MODE (narrow_vectype))
- return true;
+ return (!VECTOR_BOOLEAN_TYPE_P (vectype)
+ || (TYPE_VECTOR_SUBPARTS (intermediate_type) * 2
+ == TYPE_VECTOR_SUBPARTS (narrow_vectype)));
prev_mode = intermediate_mode;
prev_type = intermediate_type;