re PR tree-optimization/71006 (ICE: verify_gimple failed (error: type mismatch in...
authorIlya Enkovich <ilya.enkovich@intel.com>
Thu, 12 May 2016 11:27:49 +0000 (11:27 +0000)
committerIlya Enkovich <ienkovich@gcc.gnu.org>
Thu, 12 May 2016 11:27:49 +0000 (11:27 +0000)
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

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr71006.c [new file with mode: 0644]
gcc/tree-vect-loop.c

index 711d8d590929ca17b11ae2f99b36c8b537f429dc..d610977bf9e3f60b325c8bf8c92516772112e6ef 100644 (file)
@@ -1,3 +1,9 @@
+2016-05-12  Ilya Enkovich  <ilya.enkovich@intel.com>
+
+       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  <polacek@redhat.com>
 
        PR driver/71063
index c1b2323e07caa89500c63947187e0823701e34ef..d61bb26799dbe8ed0a672dd973f0bf95d884eee3 100644 (file)
@@ -1,3 +1,8 @@
+2016-05-12  Ilya Enkovich  <ilya.enkovich@intel.com>
+
+       PR tree-optimization/71006
+       * gcc.dg/pr71006.c: New test.
+
 2016-05-12  Marek Polacek  <polacek@redhat.com>
 
        PR driver/71063
diff --git a/gcc/testsuite/gcc.dg/pr71006.c b/gcc/testsuite/gcc.dg/pr71006.c
new file mode 100644 (file)
index 0000000..2b45aa0
--- /dev/null
@@ -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;
+    }
+}
index da98211b27c53237450278589dbd1692f187fded..d673c67b4a0adc4ef6c75dd0ffb412f151172a08 100644 (file)
@@ -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);