Hi!

On Tue, 16 May 2017 20:55:46 +0800, Chung-Lin Tang <chunglin_t...@mentor.com> 
wrote:
> finalize clause of the exit data directive

The OpenACC front end code currently maps the OpenACC delete clause to
"OMP_CLAUSE_DELETE" -- however, without a finalize clause, this clause
actually has "OMP_CLAUSE_RELEASE" semantics.  Committed to
gomp-4_0-branch in r248147:

commit 09ce4545696d19c65a552098187184f179096b45
Author: tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Wed May 17 11:46:53 2017 +0000

    Use "GOMP_MAP_RELEASE" for OpenACC delete clause without finalize clause
    
            gcc/c/
            * c-parser.c (c_parser_oacc_data_clause)
            <PRAGMA_OACC_CLAUSE_DELETE>: Use "GOMP_MAP_RELEASE".
            gcc/cp/
            * parser.c (cp_parser_oacc_data_clause)
            <PRAGMA_OACC_CLAUSE_DELETE>: Use "GOMP_MAP_RELEASE".
            gcc/fortran/
            * openmp.c (gfc_match_omp_clauses) <OMP_CLAUSE_DELETE>: Use
            "OMP_MAP_RELEASE".
            gcc/
            * gimplify.c (gimplify_oacc_declare_1) <GOMP_MAP_ALLOC>: Use
            "GOMP_MAP_RELEASE".
            libgomp/
            * oacc-parallel.c (GOACC_enter_exit_data, GOACC_declare): Handle
            "GOMP_MAP_RELEASE".
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gomp-4_0-branch@248147 
138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog.gomp         | 5 +++++
 gcc/c/ChangeLog.gomp       | 5 +++++
 gcc/c/c-parser.c           | 2 +-
 gcc/cp/ChangeLog.gomp      | 5 +++++
 gcc/cp/parser.c            | 2 +-
 gcc/fortran/ChangeLog.gomp | 3 +++
 gcc/fortran/openmp.c       | 2 +-
 gcc/gimplify.c             | 2 +-
 libgomp/ChangeLog.gomp     | 5 +++++
 libgomp/oacc-parallel.c    | 5 ++++-
 10 files changed, 31 insertions(+), 5 deletions(-)

diff --git gcc/ChangeLog.gomp gcc/ChangeLog.gomp
index 77c7899..e858e78 100644
--- gcc/ChangeLog.gomp
+++ gcc/ChangeLog.gomp
@@ -1,3 +1,8 @@
+2017-05-17  Thomas Schwinge  <tho...@codesourcery.com>
+
+       * gimplify.c (gimplify_oacc_declare_1) <GOMP_MAP_ALLOC>: Use
+       "GOMP_MAP_RELEASE".
+
 2017-05-16  Cesar Philippidis  <ce...@codesourcery.com>
 
        * doc/include/texinfo.tex: Backport @title linewrap changes from
diff --git gcc/c/ChangeLog.gomp gcc/c/ChangeLog.gomp
index eca8379..c70003f 100644
--- gcc/c/ChangeLog.gomp
+++ gcc/c/ChangeLog.gomp
@@ -1,3 +1,8 @@
+2017-05-17  Thomas Schwinge  <tho...@codesourcery.com>
+
+       * c-parser.c (c_parser_oacc_data_clause)
+       <PRAGMA_OACC_CLAUSE_DELETE>: Use "GOMP_MAP_RELEASE".
+
 2017-05-16  Chung-Lin Tang  <clt...@codesourcery.com>
 
        * c-parser.c (c_parser_omp_clause_name):  Handle 'finalize' clause.
diff --git gcc/c/c-parser.c gcc/c/c-parser.c
index 17045ef..34f8b17 100644
--- gcc/c/c-parser.c
+++ gcc/c/c-parser.c
@@ -10805,7 +10805,7 @@ c_parser_oacc_data_clause (c_parser *parser, 
pragma_omp_clause c_kind,
       kind = GOMP_MAP_ALLOC;
       break;
     case PRAGMA_OACC_CLAUSE_DELETE:
-      kind = GOMP_MAP_DELETE;
+      kind = GOMP_MAP_RELEASE;
       break;
     case PRAGMA_OACC_CLAUSE_DEVICE:
       kind = GOMP_MAP_FORCE_TO;
diff --git gcc/cp/ChangeLog.gomp gcc/cp/ChangeLog.gomp
index 3fa64ee..9a68194 100644
--- gcc/cp/ChangeLog.gomp
+++ gcc/cp/ChangeLog.gomp
@@ -1,3 +1,8 @@
+2017-05-17  Thomas Schwinge  <tho...@codesourcery.com>
+
+       * parser.c (cp_parser_oacc_data_clause)
+       <PRAGMA_OACC_CLAUSE_DELETE>: Use "GOMP_MAP_RELEASE".
+
 2017-05-16  Chung-Lin Tang  <clt...@codesourcery.com>
 
        * parser.c (cp_parser_omp_clause_name): Handle 'finalize' clause.
diff --git gcc/cp/parser.c gcc/cp/parser.c
index c0fe65d..cbb11d0 100644
--- gcc/cp/parser.c
+++ gcc/cp/parser.c
@@ -30222,7 +30222,7 @@ cp_parser_oacc_data_clause (cp_parser *parser, 
pragma_omp_clause c_kind,
       kind = GOMP_MAP_ALLOC;
       break;
     case PRAGMA_OACC_CLAUSE_DELETE:
-      kind = GOMP_MAP_DELETE;
+      kind = GOMP_MAP_RELEASE;
       break;
     case PRAGMA_OACC_CLAUSE_DEVICE:
       kind = GOMP_MAP_FORCE_TO;
diff --git gcc/fortran/ChangeLog.gomp gcc/fortran/ChangeLog.gomp
index 03bc82e..b3e4f8d 100644
--- gcc/fortran/ChangeLog.gomp
+++ gcc/fortran/ChangeLog.gomp
@@ -1,5 +1,8 @@
 2017-05-17  Thomas Schwinge  <tho...@codesourcery.com>
 
+       * openmp.c (gfc_match_omp_clauses) <OMP_CLAUSE_DELETE>: Use
+       "OMP_MAP_RELEASE".
+
        * openmp.c (gfc_match_omp_clauses): Handle "OMP_CLAUSE_DELETE"
        just once.
 
diff --git gcc/fortran/openmp.c gcc/fortran/openmp.c
index 0992f0a..1d191d2 100644
--- gcc/fortran/openmp.c
+++ gcc/fortran/openmp.c
@@ -1149,7 +1149,7 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, omp_mask 
mask,
          if ((mask & OMP_CLAUSE_DELETE)
              && gfc_match ("delete ( ") == MATCH_YES
              && gfc_match_omp_map_clause (&c->lists[OMP_LIST_MAP],
-                                          OMP_MAP_DELETE, true,
+                                          OMP_MAP_RELEASE, true,
                                           allow_derived))
            continue;
          if ((mask & OMP_CLAUSE_DEPEND)
diff --git gcc/gimplify.c gcc/gimplify.c
index e6cdadc..7812471 100644
--- gcc/gimplify.c
+++ gcc/gimplify.c
@@ -8593,7 +8593,7 @@ gimplify_oacc_declare_1 (tree clause)
   switch (kind)
     {
       case GOMP_MAP_ALLOC:
-       new_op = GOMP_MAP_DELETE;
+       new_op = GOMP_MAP_RELEASE;
        ret = true;
        break;
 
diff --git libgomp/ChangeLog.gomp libgomp/ChangeLog.gomp
index 856bdf2..61d0358 100644
--- libgomp/ChangeLog.gomp
+++ libgomp/ChangeLog.gomp
@@ -1,3 +1,8 @@
+2017-05-17  Thomas Schwinge  <tho...@codesourcery.com>
+
+       * oacc-parallel.c (GOACC_enter_exit_data, GOACC_declare): Handle
+       "GOMP_MAP_RELEASE".
+
 2017-05-16  Cesar Philippidis  <ce...@codesourcery.com>
 
        * libgomp.texi: Update OpenACC references to version 2.5. Add entries
diff --git libgomp/oacc-parallel.c libgomp/oacc-parallel.c
index a042aac..5b8435b 100644
--- libgomp/oacc-parallel.c
+++ libgomp/oacc-parallel.c
@@ -628,7 +628,8 @@ GOACC_enter_exit_data (int device, size_t mapnum,
          break;
        }
 
-      if (kind == GOMP_MAP_DELETE
+      if (kind == GOMP_MAP_RELEASE
+         || kind == GOMP_MAP_DELETE
          || kind == GOMP_MAP_FROM
          || kind == GOMP_MAP_FORCE_FROM
          || kind == GOMP_MAP_DECLARE_DEALLOCATE)
@@ -786,6 +787,7 @@ GOACC_enter_exit_data (int device, size_t mapnum,
          {
            switch (kind)
              {
+             case GOMP_MAP_RELEASE:
              case GOMP_MAP_DELETE:
                if (acc_is_present (hostaddrs[i], sizes[i]))
                  {
@@ -1097,6 +1099,7 @@ GOACC_declare (int device, size_t mapnum,
          case GOMP_MAP_FORCE_FROM:
          case GOMP_MAP_FORCE_TO:
          case GOMP_MAP_POINTER:
+         case GOMP_MAP_RELEASE:
          case GOMP_MAP_DELETE:
            GOACC_enter_exit_data (device, 1, &hostaddrs[i], &sizes[i],
                                   &kinds[i], 0, 0, 0);

Reply via email to