From 77524e0d975d91248c2178a7d607cc6a19209cb6 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Mon, 8 Aug 2016 21:48:48 +0200 Subject: [PATCH] re PR fortran/72716 (ICE in gfc_resolve_omp_declare_simd, at fortran/openmp.c:5156) 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 | 6 ++++++ gcc/fortran/openmp.c | 6 ++++++ gcc/testsuite/ChangeLog | 3 +++ gcc/testsuite/gfortran.dg/gomp/pr72716.f90 | 6 ++++++ 4 files changed, 21 insertions(+) create mode 100644 gcc/testsuite/gfortran.dg/gomp/pr72716.f90 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 6a56ed047a8..ef8fc17603c 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2016-08-08 Jakub Jelinek + + 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 PR fortran/71936 diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c index 9fff9942057..2fed4918907 100644 --- a/gcc/fortran/openmp.c +++ b/gcc/fortran/openmp.c @@ -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; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ddc0980566b..5e34b8595da 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2016-08-08 Jakub Jelinek + 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 index 00000000000..ff262cc9fbe --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/pr72716.f90 @@ -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 -- 2.30.2