]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-vect-stmts.c (vectorizable_comparison): Add NULL check for vectype.
authorIlya Enkovich <enkovich.gnu@gmail.com>
Thu, 28 Jan 2016 10:09:12 +0000 (10:09 +0000)
committerIlya Enkovich <ienkovich@gcc.gnu.org>
Thu, 28 Jan 2016 10:09:12 +0000 (10:09 +0000)
gcc/

* tree-vect-stmts.c (vectorizable_comparison): Add
NULL check for vectype.

gcc/testsuite/

* gcc.dg/declare-simd.c: New test.

From-SVN: r232917

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/declare-simd.c [new file with mode: 0644]
gcc/tree-vect-stmts.c

index 1dc8252f2bda517efd81a94434728113e4057de0..aa98585688a6f30907c9b98750f22853f17d3d75 100644 (file)
@@ -1,3 +1,8 @@
+2016-01-28  Ilya Enkovich  <enkovich.gnu@gmail.com>
+
+       * tree-vect-stmts.c (vectorizable_comparison): Add
+       NULL check for vectype.
+
 2016-01-28  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/69466
index 60c87fe9f9f284f3b56ee470464739731c393ad1..fb29f731b2a8b29efff89600e912a44199e4df2b 100644 (file)
@@ -1,3 +1,7 @@
+2016-01-28  Ilya Enkovich  <enkovich.gnu@gmail.com>
+
+       * gcc.dg/declare-simd.c: New test.
+
 2016-01-28  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/69466
diff --git a/gcc/testsuite/gcc.dg/declare-simd.c b/gcc/testsuite/gcc.dg/declare-simd.c
new file mode 100644 (file)
index 0000000..1c71b60
--- /dev/null
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fopenmp-simd" } */
+
+#pragma omp declare simd linear (p2, p3)
+extern void fn2 (float p1, float *p2, float *p3);
+
+float *a, *b;
+void fn1 (float *p1)
+{
+  int i;
+#pragma omp simd
+  for (i = 0; i < 1000; i++)
+    fn2 (p1[i], a + i, b + i);
+}
index 1dcd12959307c0fb0b6b83b655265a4cb009a528..fa4a364983a62496210b275d09045be5cb75ff50 100644 (file)
@@ -7764,7 +7764,7 @@ vectorizable_comparison (gimple *stmt, gimple_stmt_iterator *gsi,
   if (!STMT_VINFO_RELEVANT_P (stmt_info) && !bb_vinfo)
     return false;
 
-  if (!VECTOR_BOOLEAN_TYPE_P (vectype))
+  if (!vectype || !VECTOR_BOOLEAN_TYPE_P (vectype))
     return false;
 
   mask_type = vectype;