From: Jakub Jelinek Date: Fri, 20 Dec 2019 17:35:18 +0000 (+0100) Subject: re PR fortran/92756 (ICE in lower_omp, at omp-low.c:12988) X-Git-Tag: releases/gcc-9.3.0~287 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4833bc152286a2f5d803a05a79b835e6df049f69;p=thirdparty%2Fgcc.git re PR fortran/92756 (ICE in lower_omp, at omp-low.c:12988) PR fortran/92756 * omp-low.c (check_omp_nesting_restrictions): If lang_GNU_Fortran, diagnose teams not closely nested inside of target. Backported from mainline 2019-12-04 Jakub Jelinek PR fortran/92756 * gfortran.dg/gomp/teams1.f90: New test. From-SVN: r279666 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 41b10d6c27dd..fd856d9e78ec 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ 2019-12-20 Jakub Jelinek + PR fortran/92756 + * omp-low.c (check_omp_nesting_restrictions): If lang_GNU_Fortran, + diagnose teams not closely nested inside of target. + Backported from mainline 2019-11-27 Jakub Jelinek diff --git a/gcc/omp-low.c b/gcc/omp-low.c index f9ab91aafaaf..81280296a24b 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -3041,6 +3041,16 @@ check_omp_nesting_restrictions (gimple *stmt, omp_context *ctx) } break; case GIMPLE_OMP_TEAMS: + if ((ctx == NULL + || gimple_code (ctx->stmt) != GIMPLE_OMP_TARGET + || gimple_omp_target_kind (ctx->stmt) != GF_OMP_TARGET_KIND_REGION) + && lang_GNU_Fortran ()) + { + error_at (gimple_location (stmt), + "% construct not closely nested inside of " + "% construct"); + return false; + } if (ctx == NULL) break; else if (gimple_code (ctx->stmt) != GIMPLE_OMP_TARGET diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a116f43b4538..c7b96bb4395a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,6 +1,11 @@ 2019-12-20 Jakub Jelinek Backported from mainline + 2019-12-04 Jakub Jelinek + + PR fortran/92756 + * gfortran.dg/gomp/teams1.f90: New test. + 2019-12-03 Jakub Jelinek PR c++/92732 diff --git a/gcc/testsuite/gfortran.dg/gomp/teams1.f90 b/gcc/testsuite/gfortran.dg/gomp/teams1.f90 new file mode 100644 index 000000000000..5456bc80479e --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/teams1.f90 @@ -0,0 +1,8 @@ +! PR fortran/92756 + +program pr92756 + integer :: i + !$omp teams distribute parallel do ! { dg-error "'teams' construct not closely nested inside of 'target' construct" } + do i = 1, 64 + end do +end