From: Ilya Enkovich Date: Thu, 12 May 2016 11:27:49 +0000 (+0000) Subject: re PR tree-optimization/71006 (ICE: verify_gimple failed (error: type mismatch in... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c4ec12434da32096a04651ccb4afabe0297ac939;p=gcc.git re PR tree-optimization/71006 (ICE: verify_gimple failed (error: type mismatch in conditional expression) w/ -O1 -ftree-loop-vectorize) gcc/ PR tree-optimization/71006 * tree-vect-loop.c (vect_determine_vectorization_factor): Don't consider COND_EXPR as a mask producer. gcc/testsuite/ PR tree-optimization/71006 * gcc.dg/pr71006.c: New test. From-SVN: r236171 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 711d8d59092..d610977bf9e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-05-12 Ilya Enkovich + + PR tree-optimization/71006 + * tree-vect-loop.c (vect_determine_vectorization_factor): Don't + consider COND_EXPR as a mask producer. + 2016-05-12 Marek Polacek PR driver/71063 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c1b2323e07c..d61bb26799d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-05-12 Ilya Enkovich + + PR tree-optimization/71006 + * gcc.dg/pr71006.c: New test. + 2016-05-12 Marek Polacek PR driver/71063 diff --git a/gcc/testsuite/gcc.dg/pr71006.c b/gcc/testsuite/gcc.dg/pr71006.c new file mode 100644 index 00000000000..2b45aa01c7e --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr71006.c @@ -0,0 +1,16 @@ +/* PR target/71006 */ +/* { dg-do compile } */ +/* { dg-options "-O1 -ftree-vectorize" } */ + +unsigned char uu, gu, e2; + +void +fs (void) +{ + char *nq = (char *)&gu, *k4 = (char *)&gu; + while (*k4 < 1) + { + uu += (*nq != 0 || e2 != 0); + ++*k4; + } +} diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index da98211b27c..d673c67b4a0 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -437,7 +437,9 @@ 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 (TREE_CODE (scalar_type) == BOOLEAN_TYPE + && is_gimple_assign (stmt) + && gimple_assign_rhs_code (stmt) != COND_EXPR) { if (STMT_VINFO_RELEVANT_P (stmt_info)) mask_producers.safe_push (stmt_info);