re PR fortran/72716 (ICE in gfc_resolve_omp_declare_simd, at fortran/openmp.c:5156)
authorJakub Jelinek <jakub@redhat.com>
Mon, 8 Aug 2016 19:48:48 +0000 (21:48 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 8 Aug 2016 19:48:48 +0000 (21:48 +0200)
PR fortran/72716
* openmp.c (gfc_match_omp_declare_simd): Don't stick anything into
BLOCK DATA ns, it will be rejected later.

* gfortran.dg/gomp/pr72716.f90: New test.

From-SVN: r239250

gcc/fortran/ChangeLog
gcc/fortran/openmp.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/gomp/pr72716.f90 [new file with mode: 0644]

index 6a56ed047a8cd6ff530d91747156700553e00a4b..ef8fc17603c93a1c0c3762b3bdf2eac3b7880688 100644 (file)
@@ -1,3 +1,9 @@
+2016-08-08  Jakub Jelinek  <jakub@redhat.com>
+
+       PR fortran/72716
+       * openmp.c (gfc_match_omp_declare_simd): Don't stick anything into
+       BLOCK DATA ns, it will be rejected later.
+
 2016-08-08  Andre Vehreschild  <vehre@gcc.gnu.org>
 
        PR fortran/71936
index 9fff9942057b671ba6fdd099e8486a6bfdf95352..2fed491890701ff51305042a4f9dbb5a774d9079 100644 (file)
@@ -2000,6 +2000,12 @@ gfc_match_omp_declare_simd (void)
                             false) != MATCH_YES)
     return MATCH_ERROR;
 
+  if (gfc_current_ns->is_block_data)
+    {
+      gfc_free_omp_clauses (c);
+      return MATCH_YES;
+    }
+
   ods = gfc_get_omp_declare_simd ();
   ods->where = where;
   ods->proc_name = proc_name;
index ddc0980566bc76d57937ff40057a9c066266eb02..5e34b8595da47544d8bb02a99ff285882aa8e556 100644 (file)
@@ -1,5 +1,8 @@
 2016-08-08  Jakub Jelinek  <jakub@redhat.com>
 
+       PR fortran/72716
+       * gfortran.dg/gomp/pr72716.f90: New test.
+
        PR middle-end/72781
        * gcc.dg/gomp/pr72781.c: New test.
 
diff --git a/gcc/testsuite/gfortran.dg/gomp/pr72716.f90 b/gcc/testsuite/gfortran.dg/gomp/pr72716.f90
new file mode 100644 (file)
index 0000000..ff262cc
--- /dev/null
@@ -0,0 +1,6 @@
+! PR fortran/72716
+! { dg-do compile }
+
+block data
+  !$omp declare simd (z)       ! { dg-error "statement is not allowed inside of BLOCK DATA" }
+end block data