re PR middle-end/81052 (ICE in verify_dominators, at dominance.c:1184)
authorJakub Jelinek <jakub@redhat.com>
Thu, 3 Aug 2017 08:34:16 +0000 (10:34 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 3 Aug 2017 08:34:16 +0000 (10:34 +0200)
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

gcc/ChangeLog
gcc/omp-low.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/pr81052.c [new file with mode: 0644]

index 16b03043c7a16d1f1005477b70a95db419ee2ca2..a9b923a22fa89e9466955dc2f64bc0e6f2fa164f 100644 (file)
@@ -1,3 +1,9 @@
+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.
index bf3fc53b07a6779f17e64102bf24937fb9be1f0e..2e0973e06d16489d5ac041cb6ae2204151275805 100644 (file)
@@ -9083,7 +9083,7 @@ diagnose_sb_0 (gimple_stmt_iterator *gsi_p,
     }
   if (kind == NULL)
     {
-      gcc_checking_assert (flag_openmp);
+      gcc_checking_assert (flag_openmp || flag_openmp_simd);
       kind = "OpenMP";
     }
 
@@ -9343,7 +9343,7 @@ public:
   /* 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 *)
     {
index a19e40f6a0afb626c0c68e8e4a245130e096591a..a8077a53341b9ad9ca83d68b18526586314364c2 100644 (file)
@@ -1,3 +1,8 @@
+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.
diff --git a/gcc/testsuite/c-c++-common/pr81052.c b/gcc/testsuite/c-c++-common/pr81052.c
new file mode 100644 (file)
index 0000000..6bc2879
--- /dev/null
@@ -0,0 +1,28 @@
+/* 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