Fix PR91114

Message ID alpine.LSU.2.20.1907091523440.2976@zhemvz.fhfr.qr
State New
Headers show
Series
  • Fix PR91114
Related show

Commit Message

Richard Biener July 9, 2019, 1:24 p.m.
The following fixes PR91114.  It's not really the most desirable
solution but hey.

Bootstrapped / tested on x86_64-unknown-linux-gnu, applied to trunk.

Richard.

2019-07-09  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/91114
	* tree-vect-data-refs.c (vect_analyze_data_refs): Failure to
	find a vector type isn't fatal.

	* gcc.dg/vect/pr91114.c: New testcase.

Patch

Index: gcc/tree-vect-data-refs.c
===================================================================
--- gcc/tree-vect-data-refs.c	(revision 273294)
+++ gcc/tree-vect-data-refs.c	(working copy)
@@ -4360,6 +4360,8 @@  vect_analyze_data_refs (vec_info *vinfo,
 	      STMT_VINFO_VECTORIZABLE (stmt_info) = false;
 	      continue;
 	    }
+	  if (fatal)
+	    *fatal = false;
 	  return opt_result::failure_at (stmt_info->stmt,
 					 "not vectorized:"
 					 " no vectype for stmt: %G"
Index: gcc/testsuite/gcc.dg/vect/pr91114.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/pr91114.c	(nonexistent)
+++ gcc/testsuite/gcc.dg/vect/pr91114.c	(working copy)
@@ -0,0 +1,12 @@ 
+/* { dg-do compile } */
+/* { dg-additional-options "-fopenmp-simd" } */
+
+void
+ne (double *zu)
+{
+  int h3;
+
+#pragma omp simd simdlen (4)
+  for (h3 = 0; h3 < 4; ++h3)
+    zu[h3] = 0;
+}