]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR fortran/92756 (ICE in lower_omp, at omp-low.c:12988)
authorJakub Jelinek <jakub@redhat.com>
Fri, 20 Dec 2019 17:35:18 +0000 (18:35 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 20 Dec 2019 17:35:18 +0000 (18:35 +0100)
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  <jakub@redhat.com>

PR fortran/92756
* gfortran.dg/gomp/teams1.f90: New test.

From-SVN: r279666

gcc/ChangeLog
gcc/omp-low.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/gomp/teams1.f90 [new file with mode: 0644]

index 41b10d6c27dd89059157611a9d377339abc077a7..fd856d9e78ec3658afdc6945b99ed2d179af2632 100644 (file)
@@ -1,5 +1,9 @@
 2019-12-20  Jakub Jelinek  <jakub@redhat.com>
 
+       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  <jakub@redhat.com>
 
index f9ab91aafaafb5949a4f67b73b15a6bb14f4358b..81280296a24ba9b27495f9bd38f4287820fa80af 100644 (file)
@@ -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),
+                   "%<teams%> construct not closely nested inside of "
+                   "%<target%> construct");
+         return false;
+       }
       if (ctx == NULL)
        break;
       else if (gimple_code (ctx->stmt) != GIMPLE_OMP_TARGET
index a116f43b453879bafd008eeb938067b1e2e3c19b..c7b96bb4395a4e16d4136b793852e6a138a12ebe 100644 (file)
@@ -1,6 +1,11 @@
 2019-12-20  Jakub Jelinek  <jakub@redhat.com>
 
        Backported from mainline
+       2019-12-04  Jakub Jelinek  <jakub@redhat.com>
+
+       PR fortran/92756
+       * gfortran.dg/gomp/teams1.f90: New test.
+
        2019-12-03  Jakub Jelinek  <jakub@redhat.com>
 
        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 (file)
index 0000000..5456bc8
--- /dev/null
@@ -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