PR middle-end/81052
* omp-low.c (diagnose_sb_0): Handle flag_openmp_simd like flag_openmp.
(pass_diagnose_omp_blocks::gate): Enable also for flag_openmp_simd.
* c-c++-common/pr81052.c: New test.
From-SVN: r250847
+2017-08-03 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/81052
+ * omp-low.c (diagnose_sb_0): Handle flag_openmp_simd like flag_openmp.
+ (pass_diagnose_omp_blocks::gate): Enable also for flag_openmp_simd.
+
2017-08-03 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
* tree-vrp.h: Add include guard.
}
if (kind == NULL)
{
- gcc_checking_assert (flag_openmp);
+ gcc_checking_assert (flag_openmp || flag_openmp_simd);
kind = "OpenMP";
}
/* opt_pass methods: */
virtual bool gate (function *)
{
- return flag_cilkplus || flag_openacc || flag_openmp;
+ return flag_cilkplus || flag_openacc || flag_openmp || flag_openmp_simd;
}
virtual unsigned int execute (function *)
{
+2017-08-03 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/81052
+ * c-c++-common/pr81052.c: New test.
+
2017-08-03 Tom de Vries <tom@codesourcery.com>
* gcc.dg/pr56727-2.c: Require alias.
--- /dev/null
+/* PR middle-end/81052 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp-simd -O2" } */
+
+int
+foo (int x, int y)
+{
+ int i;
+#pragma omp simd
+ for (i = x; i < y; ++i)
+ return 0; /* { dg-error "invalid branch to/from OpenMP structured block" } */
+ return 1;
+}
+
+#ifdef __cplusplus
+template <typename T>
+T
+bar (T x, T y)
+{
+ T i;
+#pragma omp simd
+ for (i = x; i < y; ++i)
+ return 0; /* { dg-error "invalid branch to/from OpenMP structured block" "" { target c++ } } */
+ return 1;
+}
+
+int x = bar (1, 7);
+#endif