diff mbox

Including a file from include/ in gcc/*.h (was: [gomp4] Use include/gomp-constants.h more actively)

Message ID 87fvcbr0eb.fsf@schwinge.name
State New
Headers show

Commit Message

Thomas Schwinge Dec. 19, 2014, 5:54 p.m. UTC
Hi Jakub!

On Thu, 18 Dec 2014 19:33:07 +0100, Jakub Jelinek <jakub@redhat.com> wrote:
> On Thu, Dec 18, 2014 at 07:25:03PM +0100, Thomas Schwinge wrote:
> > On Wed, 17 Dec 2014 23:26:53 +0100, I wrote:
> > > Committed to gomp-4_0-branch in r218840:
> > > 
> > > commit febcd8dfdb10fa80edff0880973d1915ca2fef74
> > > Author: tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
> > > Date:   Wed Dec 17 22:26:24 2014 +0000
> > > 
> > >     Use include/gomp-constants.h more actively.
> > 
> > > diff --git gcc/tree-core.h gcc/tree-core.h
> > > index 743bc0d..fc61b88 100644
> > > --- gcc/tree-core.h
> > > +++ gcc/tree-core.h
> > > @@ -32,6 +32,7 @@ along with GCC; see the file COPYING3.  If not see
> > >  #include "alias.h"
> > >  #include "flags.h"
> > >  #include "symtab.h"
> > > +#include "gomp-constants.h"
> > >  
> > >  /* This file contains all the data structures that define the 'tree' type.
> > >     There are no accessor macros nor functions in this file. Only the
> > 
> > Is it actually "OK" to #include "gomp-constants.h" (living in
> > [GCC]/include/) from gcc/tree-core.h?  Isn't the tree-core.h file getting
> > installed, for later use by plugins -- which then need to be able to find
> > gomp-constants, too, but that is not being installed?
> 
> Generally, it must be possible to include include/ headers from gcc/
> headers, even when they are used by plugins.  Otherwise system.h including
> libiberty.h and safe-ctype.h etc. wouldn't work.  Perhaps you need to add
> gomp-constants.h to some Makefile variable or something, look at how is
> safe-ctype.h etc. handled.

Aha, that's how it is done, I guess, in gcc/Makefile.in:

    [...]
    SYSTEM_H = system.h hwint.h $(srcdir)/../include/libiberty.h \
            $(srcdir)/../include/safe-ctype.h $(srcdir)/../include/filenames.h
    [...]
    PLUGIN_HEADERS = $(TREE_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h [...]
    [...]
    # Install the headers needed to build a plugin.
    install-plugin: installdirs lang.install-plugin s-header-vars install-gengtype
    # We keep the directory structure for files in config or c-family and .def
    # files. All other files are flattened to a single directory.
            $(mkinstalldirs) $(DESTDIR)$(plugin_includedir)
            headers=`echo $(PLUGIN_HEADERS) | tr ' ' '\012' | sort -u`; \
            [...]
    [...]

> That said, including gomp-constants.h from tree-core.h is I think very much
> against all the Andrew's efforts to flatten headers (which is something I'm
> not very happy with generally, but in this case, I think only the very few
> files that really need the constants should include it).

Like this (not yet applied)?

Talking about external code (GCC plugins), do we have to take any
measures about the removed enum omp_clause_map_kind?  (Would a mere
»#define omp_clause_map_kind gomp_map_kind« work?  That'd also mean that
we do have to add include/gomp-constants.h to PLUGIN_HEADERS, and get it
included automatically, I think?)

commit b1255597c6b069719960e53e385399c479c4be8b
Author: Thomas Schwinge <thomas@codesourcery.com>
Date:   Fri Dec 19 18:32:25 2014 +0100

    Replace enum omp_clause_map_kind with enum gomp_map_kind.
    
    	gcc/
    	* tree-core.h: Instead of defining enum omp_clause_map_kind, use
    	include/gomp-constants.h's enum gomp_map_kind.  Update all users.
    	include/
    	* gomp-constants.h: Populate enum gomp_map_kind.
---
 gcc/c/c-parser.c           | 38 ++++++++++++++---------------
 gcc/c/c-typeck.c           |  9 +++----
 gcc/cp/parser.c            | 38 ++++++++++++++---------------
 gcc/cp/semantics.c         |  9 +++----
 gcc/fortran/trans-openmp.c | 47 ++++++++++++++++++------------------
 gcc/gimplify.c             | 18 +++++++-------
 gcc/omp-low.c              | 60 ++++++++++++++++++++++------------------------
 gcc/tree-core.h            | 43 +++------------------------------
 gcc/tree-nested.c          |  8 +++----
 gcc/tree-pretty-print.c    | 31 ++++++++++++------------
 gcc/tree-streamer-in.c     |  2 +-
 gcc/tree-streamer-out.c    |  2 +-
 gcc/tree.h                 |  4 ++--
 include/gomp-constants.h   | 50 +++++++++++++++++++++++++++-----------
 14 files changed, 173 insertions(+), 186 deletions(-)



Grüße,
 Thomas

Comments

Jakub Jelinek Dec. 19, 2014, 7:44 p.m. UTC | #1
On Fri, Dec 19, 2014 at 06:54:04PM +0100, Thomas Schwinge wrote:
> Like this (not yet applied)?

I think it is fine, though the ChangeLog entry is not.  Though in the late
of hopefully soonish merge and creation of full ChangeLog entry it is not a
big deal.

	Jakub
Thomas Schwinge Dec. 22, 2014, 3:13 p.m. UTC | #2
Hi!

I'm sending this again with some more people copied -- because I see
you're working on tree.h/tree-core.h flattening, or know you're familiar
with GCC plugins.  ;-) Here is a question concerning both of that, where
I'd appreciate your input.

(That said, I don't find a "GCC plugins" person listed in the MAINTAINERS
file, would that be worth adding?)

Full quote follows:

On Fri, 19 Dec 2014 18:54:04 +0100, I wrote:
> On Thu, 18 Dec 2014 19:33:07 +0100, Jakub Jelinek <jakub@redhat.com> wrote:
> > On Thu, Dec 18, 2014 at 07:25:03PM +0100, Thomas Schwinge wrote:
> > > On Wed, 17 Dec 2014 23:26:53 +0100, I wrote:
> > > > Committed to gomp-4_0-branch in r218840:
> > > > 
> > > > commit febcd8dfdb10fa80edff0880973d1915ca2fef74
> > > > Author: tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
> > > > Date:   Wed Dec 17 22:26:24 2014 +0000
> > > > 
> > > >     Use include/gomp-constants.h more actively.
> > > 
> > > > diff --git gcc/tree-core.h gcc/tree-core.h
> > > > index 743bc0d..fc61b88 100644
> > > > --- gcc/tree-core.h
> > > > +++ gcc/tree-core.h
> > > > @@ -32,6 +32,7 @@ along with GCC; see the file COPYING3.  If not see
> > > >  #include "alias.h"
> > > >  #include "flags.h"
> > > >  #include "symtab.h"
> > > > +#include "gomp-constants.h"
> > > >  
> > > >  /* This file contains all the data structures that define the 'tree' type.
> > > >     There are no accessor macros nor functions in this file. Only the
> > > 
> > > Is it actually "OK" to #include "gomp-constants.h" (living in
> > > [GCC]/include/) from gcc/tree-core.h?  Isn't the tree-core.h file getting
> > > installed, for later use by plugins -- which then need to be able to find
> > > gomp-constants, too, but that is not being installed?
> > 
> > Generally, it must be possible to include include/ headers from gcc/
> > headers, even when they are used by plugins.  Otherwise system.h including
> > libiberty.h and safe-ctype.h etc. wouldn't work.  Perhaps you need to add
> > gomp-constants.h to some Makefile variable or something, look at how is
> > safe-ctype.h etc. handled.
> 
> Aha, that's how it is done, I guess, in gcc/Makefile.in:
> 
>     [...]
>     SYSTEM_H = system.h hwint.h $(srcdir)/../include/libiberty.h \
>             $(srcdir)/../include/safe-ctype.h $(srcdir)/../include/filenames.h
>     [...]
>     PLUGIN_HEADERS = $(TREE_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h [...]
>     [...]
>     # Install the headers needed to build a plugin.
>     install-plugin: installdirs lang.install-plugin s-header-vars install-gengtype
>     # We keep the directory structure for files in config or c-family and .def
>     # files. All other files are flattened to a single directory.
>             $(mkinstalldirs) $(DESTDIR)$(plugin_includedir)
>             headers=`echo $(PLUGIN_HEADERS) | tr ' ' '\012' | sort -u`; \
>             [...]
>     [...]
> 
> > That said, including gomp-constants.h from tree-core.h is I think very much
> > against all the Andrew's efforts to flatten headers (which is something I'm
> > not very happy with generally, but in this case, I think only the very few
> > files that really need the constants should include it).
> 
> Like this (not yet applied)?

[Jakub: »I think it is fine.«]

> Talking about external code (GCC plugins), do we have to take any
> measures about the removed enum omp_clause_map_kind?  (Would a mere
> »#define omp_clause_map_kind gomp_map_kind« work?  That'd also mean that
> we do have to add include/gomp-constants.h to PLUGIN_HEADERS, and get it
> included automatically, I think?)
> 
> commit b1255597c6b069719960e53e385399c479c4be8b
> Author: Thomas Schwinge <thomas@codesourcery.com>
> Date:   Fri Dec 19 18:32:25 2014 +0100
> 
>     Replace enum omp_clause_map_kind with enum gomp_map_kind.
>     
>     	gcc/
>     	* tree-core.h: Instead of defining enum omp_clause_map_kind, use
>     	include/gomp-constants.h's enum gomp_map_kind.  Update all users.
>     	include/
>     	* gomp-constants.h: Populate enum gomp_map_kind.
> ---
>  gcc/c/c-parser.c           | 38 ++++++++++++++---------------
>  gcc/c/c-typeck.c           |  9 +++----
>  gcc/cp/parser.c            | 38 ++++++++++++++---------------
>  gcc/cp/semantics.c         |  9 +++----
>  gcc/fortran/trans-openmp.c | 47 ++++++++++++++++++------------------
>  gcc/gimplify.c             | 18 +++++++-------
>  gcc/omp-low.c              | 60 ++++++++++++++++++++++------------------------
>  gcc/tree-core.h            | 43 +++------------------------------
>  gcc/tree-nested.c          |  8 +++----
>  gcc/tree-pretty-print.c    | 31 ++++++++++++------------
>  gcc/tree-streamer-in.c     |  2 +-
>  gcc/tree-streamer-out.c    |  2 +-
>  gcc/tree.h                 |  4 ++--
>  include/gomp-constants.h   | 50 +++++++++++++++++++++++++++-----------
>  14 files changed, 173 insertions(+), 186 deletions(-)

Here is (this is on top of gomp-4_0-branch, by the way) the patch:
reordererd, and snipped to relevant parts.

The new "provider":

> --- include/gomp-constants.h
> +++ include/gomp-constants.h
> @@ -32,7 +32,7 @@
>  /* Memory mapping types.  */
>  
>  /* One byte.  */
> -#define GOMP_MAP_VALUE_LIMIT		(1 << 8)
> +#define GOMP_MAP_LAST			(1 << 8)
>  
>  #define GOMP_MAP_FLAG_TO		(1 << 0)
>  #define GOMP_MAP_FLAG_FROM		(1 << 1)
> @@ -44,19 +44,41 @@
>  /* Flag to force a specific behavior (or else, trigger a run-time error).  */
>  #define GOMP_MAP_FLAG_FORCE		(1 << 7)
>  
> -#define GOMP_MAP_ALLOC			0
> -#define GOMP_MAP_TO			(GOMP_MAP_ALLOC | GOMP_MAP_FLAG_TO)
> -#define GOMP_MAP_FROM			(GOMP_MAP_ALLOC | GOMP_MAP_FLAG_FROM)
> -#define GOMP_MAP_TOFROM			(GOMP_MAP_TO | GOMP_MAP_FROM)
> -#define GOMP_MAP_POINTER		(GOMP_MAP_FLAG_SPECIAL_0 | 0)
> -#define GOMP_MAP_TO_PSET		(GOMP_MAP_FLAG_SPECIAL_0 | 1)
> -#define GOMP_MAP_FORCE_PRESENT		(GOMP_MAP_FLAG_SPECIAL_0 | 2)
> -#define GOMP_MAP_FORCE_DEALLOC		(GOMP_MAP_FLAG_SPECIAL_0 | 3)
> -#define GOMP_MAP_FORCE_DEVICEPTR	(GOMP_MAP_FLAG_SPECIAL_1 | 0)
> -#define GOMP_MAP_FORCE_ALLOC		(GOMP_MAP_FLAG_FORCE | GOMP_MAP_ALLOC)
> -#define GOMP_MAP_FORCE_TO		(GOMP_MAP_FLAG_FORCE | GOMP_MAP_TO)
> -#define GOMP_MAP_FORCE_FROM		(GOMP_MAP_FLAG_FORCE | GOMP_MAP_FROM)
> -#define GOMP_MAP_FORCE_TOFROM		(GOMP_MAP_FLAG_FORCE | GOMP_MAP_TOFROM)
> +enum gomp_map_kind
> +  {
> +    /* If not already present, allocate.  */
> +    GOMP_MAP_ALLOC =			0,
> +    /* ..., and copy to device.  */
> +    GOMP_MAP_TO =			(GOMP_MAP_ALLOC | GOMP_MAP_FLAG_TO),
> +    /* ..., and copy from device.  */
> +    GOMP_MAP_FROM =			(GOMP_MAP_ALLOC | GOMP_MAP_FLAG_FROM),
> +    /* ..., and copy to and from device.  */
> +    GOMP_MAP_TOFROM =			(GOMP_MAP_TO | GOMP_MAP_FROM),
> +    /* The following kind is an internal only map kind, used for pointer based
> +       array sections.  OMP_CLAUSE_SIZE for these is not the pointer size,
> +       which is implicitly POINTER_SIZE_UNITS, but the bias.  */
> +    GOMP_MAP_POINTER =			(GOMP_MAP_FLAG_SPECIAL_0 | 0),
> +    /* Also internal, behaves like GOMP_MAP_TO, but additionally any
> +       GOMP_MAP_POINTER records consecutive after it which have addresses
> +       falling into that range will not be ignored if GOMP_MAP_TO_PSET wasn't
> +       mapped already.  */
> +    GOMP_MAP_TO_PSET =			(GOMP_MAP_FLAG_SPECIAL_0 | 1),
> +    /* Must already be present.  */
> +    GOMP_MAP_FORCE_PRESENT =		(GOMP_MAP_FLAG_SPECIAL_0 | 2),
> +    /* Deallocate a mapping, without copying from device.  */
> +    GOMP_MAP_FORCE_DEALLOC =		(GOMP_MAP_FLAG_SPECIAL_0 | 3),
> +    /* Is a device pointer.  OMP_CLAUSE_SIZE for these is unused; is implicitly
> +       POINTER_SIZE_UNITS.  */
> +    GOMP_MAP_FORCE_DEVICEPTR =		(GOMP_MAP_FLAG_SPECIAL_1 | 0),
> +    /* Allocate.  */
> +    GOMP_MAP_FORCE_ALLOC =		(GOMP_MAP_FLAG_FORCE | GOMP_MAP_ALLOC),
> +    /* ..., and copy to device.  */
> +    GOMP_MAP_FORCE_TO =			(GOMP_MAP_FLAG_FORCE | GOMP_MAP_TO),
> +    /* ..., and copy from device.  */
> +    GOMP_MAP_FORCE_FROM =		(GOMP_MAP_FLAG_FORCE | GOMP_MAP_FROM),
> +    /* ..., and copy to and from device.  */
> +    GOMP_MAP_FORCE_TOFROM =		(GOMP_MAP_FLAG_FORCE | GOMP_MAP_TOFROM)
> +  };
>  
>  #define GOMP_MAP_COPY_TO_P(X) \
>    (!((X) & GOMP_MAP_FLAG_SPECIAL) \

The former "provider":

> --- gcc/tree-core.h
> +++ gcc/tree-core.h
> @@ -1239,45 +1239,8 @@ enum omp_clause_depend_kind
>    OMP_CLAUSE_DEPEND_LAST
>  };
>  
> -enum omp_clause_map_kind
> -{
> -  /* If not already present, allocate.  */
> -  OMP_CLAUSE_MAP_ALLOC = GOMP_MAP_ALLOC,
> -  /* ..., and copy to device.  */
> -  OMP_CLAUSE_MAP_TO = GOMP_MAP_TO,
> -  /* ..., and copy from device.  */
> -  OMP_CLAUSE_MAP_FROM = GOMP_MAP_FROM,
> -  /* ..., and copy to and from device.  */
> -  OMP_CLAUSE_MAP_TOFROM = GOMP_MAP_TOFROM,
> -  /* The following kind is an internal only map kind, used for pointer based
> -     array sections.  OMP_CLAUSE_SIZE for these is not the pointer size,
> -     which is implicitly POINTER_SIZE_UNITS, but the bias.  */
> -  OMP_CLAUSE_MAP_POINTER = GOMP_MAP_POINTER,
> -  /* Also internal, behaves like OMP_CLAUS_MAP_TO, but additionally any
> -     OMP_CLAUSE_MAP_POINTER records consecutive after it which have addresses
> -     falling into that range will not be ignored if OMP_CLAUSE_MAP_TO_PSET
> -     wasn't mapped already.  */
> -  OMP_CLAUSE_MAP_TO_PSET = GOMP_MAP_TO_PSET,
> -  /* The following are only valid for OpenACC.  */
> -  /* Allocate.  */
> -  OMP_CLAUSE_MAP_FORCE_ALLOC = GOMP_MAP_FORCE_ALLOC,
> -  /* ..., and copy to device.  */
> -  OMP_CLAUSE_MAP_FORCE_TO = GOMP_MAP_FORCE_TO,
> -  /* ..., and copy from device.  */
> -  OMP_CLAUSE_MAP_FORCE_FROM = GOMP_MAP_FORCE_FROM,
> -  /* ..., and copy to and from device.  */
> -  OMP_CLAUSE_MAP_FORCE_TOFROM = GOMP_MAP_FORCE_TOFROM,
> -  /* Must already be present.  */
> -  OMP_CLAUSE_MAP_FORCE_PRESENT = GOMP_MAP_FORCE_PRESENT,
> -  /* Deallocate a mapping, without copying from device.  */
> -  OMP_CLAUSE_MAP_FORCE_DEALLOC = GOMP_MAP_FORCE_DEALLOC,
> -  /* Is a device pointer.  OMP_CLAUSE_SIZE for these is unused; is implicitly
> -     POINTER_SIZE_UNITS.  */
> -  OMP_CLAUSE_MAP_FORCE_DEVICEPTR = GOMP_MAP_FORCE_DEVICEPTR,
> -
> -  /* End marker.  */
> -  OMP_CLAUSE_MAP_LAST = GOMP_MAP_VALUE_LIMIT
> -};
> +/* See include/gomp-constants.h.  */
> +enum gomp_map_kind;
>  
>  enum omp_clause_proc_bind_kind
>  {
> @@ -1350,7 +1313,7 @@ struct GTY(()) tree_omp_clause {
>      enum omp_clause_default_kind   default_kind;
>      enum omp_clause_schedule_kind  schedule_kind;
>      enum omp_clause_depend_kind    depend_kind;
> -    enum omp_clause_map_kind       map_kind;
> +    enum gomp_map_kind		   map_kind;
>      enum omp_clause_proc_bind_kind proc_bind_kind;
>      enum tree_code                 reduction_code;
>    } GTY ((skip)) subcode;

A sample of the "consumers":

> --- gcc/c/c-parser.c
> +++ gcc/c/c-parser.c
> [...]
> @@ -11372,7 +11372,7 @@ static tree
>  c_parser_omp_clause_map (c_parser *parser, tree list)
>  {
>    location_t clause_loc = c_parser_peek_token (parser)->location;
> -  enum omp_clause_map_kind kind = OMP_CLAUSE_MAP_TOFROM;
> +  enum gomp_map_kind kind = GOMP_MAP_TOFROM;
>    tree nl, c;
>  
>    if (!c_parser_require (parser, CPP_OPEN_PAREN, "expected %<(%>"))
> @@ -11383,13 +11383,13 @@ c_parser_omp_clause_map (c_parser *parser, tree list)
>      {
>        const char *p = IDENTIFIER_POINTER (c_parser_peek_token (parser)->value);
>        if (strcmp ("alloc", p) == 0)
> -	kind = OMP_CLAUSE_MAP_ALLOC;
> +	kind = GOMP_MAP_ALLOC;
> [...]
> --- gcc/gimplify.c
> +++ gcc/gimplify.c
> @@ -70,6 +70,7 @@ along with GCC; see the file COPYING3.  If not see
>  #include "omp-low.h"
>  #include "gimple-low.h"
>  #include "cilk.h"
> +#include "gomp-constants.h"
>  
>  #include "langhooks-def.h"	/* FIXME: for lhd_set_decl_assembler_name */
>  #include "tree-pass.h"		/* FIXME: only for PROP_gimple_any */
> @@ -6436,8 +6437,8 @@ gimplify_adjust_omp_clauses_1 (splay_tree_node n, void *data)
>    else if (code == OMP_CLAUSE_MAP)
>      {
>        OMP_CLAUSE_MAP_KIND (clause) = flags & GOVD_MAP_TO_ONLY
> -				     ? OMP_CLAUSE_MAP_TO
> -				     : OMP_CLAUSE_MAP_TOFROM;
> +				     ? GOMP_MAP_TO
> +				     : GOMP_MAP_TOFROM;
> [...]
> --- gcc/tree-streamer-in.c
> +++ gcc/tree-streamer-in.c
> @@ -427,7 +427,7 @@ unpack_ts_omp_clause_value_fields (struct data_in *data_in,
>        break;
>      case OMP_CLAUSE_MAP:
>        OMP_CLAUSE_MAP_KIND (expr)
> -	= bp_unpack_enum (bp, omp_clause_map_kind, OMP_CLAUSE_MAP_LAST);
> +	= bp_unpack_enum (bp, gomp_map_kind, GOMP_MAP_LAST);
>        break;
>      case OMP_CLAUSE_PROC_BIND:
>        OMP_CLAUSE_PROC_BIND_KIND (expr)
> --- gcc/tree-streamer-out.c
> +++ gcc/tree-streamer-out.c
> @@ -387,7 +387,7 @@ pack_ts_omp_clause_value_fields (struct output_block *ob,
>  		    OMP_CLAUSE_DEPEND_KIND (expr));
>        break;
>      case OMP_CLAUSE_MAP:
> -      bp_pack_enum (bp, omp_clause_map_kind, OMP_CLAUSE_MAP_LAST,
> +      bp_pack_enum (bp, gomp_map_kind, GOMP_MAP_LAST,
>  		    OMP_CLAUSE_MAP_KIND (expr));
>        break;
>      case OMP_CLAUSE_PROC_BIND:


Grüße,
 Thomas
diff mbox

Patch

diff --git gcc/c/c-parser.c gcc/c/c-parser.c
index 3ad1e6b..3385a28 100644
--- gcc/c/c-parser.c
+++ gcc/c/c-parser.c
@@ -10248,45 +10248,45 @@  static tree
 c_parser_oacc_data_clause (c_parser *parser, pragma_omp_clause c_kind,
 			   tree list)
 {
-  enum omp_clause_map_kind kind;
+  enum gomp_map_kind kind;
   switch (c_kind)
     {
     case PRAGMA_OACC_CLAUSE_COPY:
-      kind = OMP_CLAUSE_MAP_FORCE_TOFROM;
+      kind = GOMP_MAP_FORCE_TOFROM;
       break;
     case PRAGMA_OACC_CLAUSE_COPYIN:
-      kind = OMP_CLAUSE_MAP_FORCE_TO;
+      kind = GOMP_MAP_FORCE_TO;
       break;
     case PRAGMA_OACC_CLAUSE_COPYOUT:
-      kind = OMP_CLAUSE_MAP_FORCE_FROM;
+      kind = GOMP_MAP_FORCE_FROM;
       break;
     case PRAGMA_OACC_CLAUSE_CREATE:
-      kind = OMP_CLAUSE_MAP_FORCE_ALLOC;
+      kind = GOMP_MAP_FORCE_ALLOC;
       break;
     case PRAGMA_OACC_CLAUSE_DELETE:
-      kind = OMP_CLAUSE_MAP_FORCE_DEALLOC;
+      kind = GOMP_MAP_FORCE_DEALLOC;
       break;
     case PRAGMA_OACC_CLAUSE_DEVICE:
-      kind = OMP_CLAUSE_MAP_FORCE_TO;
+      kind = GOMP_MAP_FORCE_TO;
       break;
     case PRAGMA_OACC_CLAUSE_HOST:
     case PRAGMA_OACC_CLAUSE_SELF:
-      kind = OMP_CLAUSE_MAP_FORCE_FROM;
+      kind = GOMP_MAP_FORCE_FROM;
       break;
     case PRAGMA_OACC_CLAUSE_PRESENT:
-      kind = OMP_CLAUSE_MAP_FORCE_PRESENT;
+      kind = GOMP_MAP_FORCE_PRESENT;
       break;
     case PRAGMA_OACC_CLAUSE_PRESENT_OR_COPY:
-      kind = OMP_CLAUSE_MAP_TOFROM;
+      kind = GOMP_MAP_TOFROM;
       break;
     case PRAGMA_OACC_CLAUSE_PRESENT_OR_COPYIN:
-      kind = OMP_CLAUSE_MAP_TO;
+      kind = GOMP_MAP_TO;
       break;
     case PRAGMA_OACC_CLAUSE_PRESENT_OR_COPYOUT:
-      kind = OMP_CLAUSE_MAP_FROM;
+      kind = GOMP_MAP_FROM;
       break;
     case PRAGMA_OACC_CLAUSE_PRESENT_OR_CREATE:
-      kind = OMP_CLAUSE_MAP_ALLOC;
+      kind = GOMP_MAP_ALLOC;
       break;
     default:
       gcc_unreachable ();
@@ -10331,7 +10331,7 @@  c_parser_oacc_data_clause_deviceptr (c_parser *parser, tree list)
 	error_at (loc, "%qD is not a pointer variable", v);
 
       tree u = build_omp_clause (loc, OMP_CLAUSE_MAP);
-      OMP_CLAUSE_MAP_KIND (u) = OMP_CLAUSE_MAP_FORCE_DEVICEPTR;
+      OMP_CLAUSE_MAP_KIND (u) = GOMP_MAP_FORCE_DEVICEPTR;
       OMP_CLAUSE_DECL (u) = v;
       OMP_CLAUSE_CHAIN (u) = list;
       list = u;
@@ -11372,7 +11372,7 @@  static tree
 c_parser_omp_clause_map (c_parser *parser, tree list)
 {
   location_t clause_loc = c_parser_peek_token (parser)->location;
-  enum omp_clause_map_kind kind = OMP_CLAUSE_MAP_TOFROM;
+  enum gomp_map_kind kind = GOMP_MAP_TOFROM;
   tree nl, c;
 
   if (!c_parser_require (parser, CPP_OPEN_PAREN, "expected %<(%>"))
@@ -11383,13 +11383,13 @@  c_parser_omp_clause_map (c_parser *parser, tree list)
     {
       const char *p = IDENTIFIER_POINTER (c_parser_peek_token (parser)->value);
       if (strcmp ("alloc", p) == 0)
-	kind = OMP_CLAUSE_MAP_ALLOC;
+	kind = GOMP_MAP_ALLOC;
       else if (strcmp ("to", p) == 0)
-	kind = OMP_CLAUSE_MAP_TO;
+	kind = GOMP_MAP_TO;
       else if (strcmp ("from", p) == 0)
-	kind = OMP_CLAUSE_MAP_FROM;
+	kind = GOMP_MAP_FROM;
       else if (strcmp ("tofrom", p) == 0)
-	kind = OMP_CLAUSE_MAP_TOFROM;
+	kind = GOMP_MAP_TOFROM;
       else
 	{
 	  c_parser_error (parser, "invalid map kind");
diff --git gcc/c/c-typeck.c gcc/c/c-typeck.c
index bf436f5..9ed887f 100644
--- gcc/c/c-typeck.c
+++ gcc/c/c-typeck.c
@@ -57,6 +57,7 @@  along with GCC; see the file COPYING3.  If not see
 #include "c-family/c-ubsan.h"
 #include "cilk.h"
 #include "wide-int.h"
+#include "gomp-constants.h"
 
 /* Possible cases of implicit bad conversions.  Used to select
    diagnostic messages in convert_for_assignment.  */
@@ -11812,9 +11813,9 @@  handle_omp_array_sections (tree c)
       OMP_CLAUSE_SIZE (c) = size;
       if (OMP_CLAUSE_CODE (c) != OMP_CLAUSE_MAP)
 	return false;
-      gcc_assert (OMP_CLAUSE_MAP_KIND (c) != OMP_CLAUSE_MAP_FORCE_DEVICEPTR);
+      gcc_assert (OMP_CLAUSE_MAP_KIND (c) != GOMP_MAP_FORCE_DEVICEPTR);
       tree c2 = build_omp_clause (OMP_CLAUSE_LOCATION (c), OMP_CLAUSE_MAP);
-      OMP_CLAUSE_MAP_KIND (c2) = OMP_CLAUSE_MAP_POINTER;
+      OMP_CLAUSE_MAP_KIND (c2) = GOMP_MAP_POINTER;
       if (!c_mark_addressable (t))
 	return false;
       OMP_CLAUSE_DECL (c2) = t;
@@ -12237,9 +12238,9 @@  c_finish_omp_clauses (tree clauses)
 	  else if (!c_mark_addressable (t))
 	    remove = true;
 	  else if (!(OMP_CLAUSE_CODE (c) == OMP_CLAUSE_MAP
-		     && (OMP_CLAUSE_MAP_KIND (c) == OMP_CLAUSE_MAP_POINTER
+		     && (OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_POINTER
 			 || (OMP_CLAUSE_MAP_KIND (c)
-			     == OMP_CLAUSE_MAP_FORCE_DEVICEPTR)))
+			     == GOMP_MAP_FORCE_DEVICEPTR)))
 		   && !lang_hooks.types.omp_mappable_type (TREE_TYPE (t)))
 	    {
 	      error_at (OMP_CLAUSE_LOCATION (c),
diff --git gcc/cp/parser.c gcc/cp/parser.c
index 3145574..a677499 100644
--- gcc/cp/parser.c
+++ gcc/cp/parser.c
@@ -27829,45 +27829,45 @@  static tree
 cp_parser_oacc_data_clause (cp_parser *parser, pragma_omp_clause c_kind,
 			    tree list)
 {
-  enum omp_clause_map_kind kind;
+  enum gomp_map_kind kind;
   switch (c_kind)
     {
     case PRAGMA_OACC_CLAUSE_COPY:
-      kind = OMP_CLAUSE_MAP_FORCE_TOFROM;
+      kind = GOMP_MAP_FORCE_TOFROM;
       break;
     case PRAGMA_OACC_CLAUSE_COPYIN:
-      kind = OMP_CLAUSE_MAP_FORCE_TO;
+      kind = GOMP_MAP_FORCE_TO;
       break;
     case PRAGMA_OACC_CLAUSE_COPYOUT:
-      kind = OMP_CLAUSE_MAP_FORCE_FROM;
+      kind = GOMP_MAP_FORCE_FROM;
       break;
     case PRAGMA_OACC_CLAUSE_CREATE:
-      kind = OMP_CLAUSE_MAP_FORCE_ALLOC;
+      kind = GOMP_MAP_FORCE_ALLOC;
       break;
     case PRAGMA_OACC_CLAUSE_DELETE:
-      kind = OMP_CLAUSE_MAP_FORCE_DEALLOC;
+      kind = GOMP_MAP_FORCE_DEALLOC;
       break;
     case PRAGMA_OACC_CLAUSE_DEVICE:
-      kind = OMP_CLAUSE_MAP_FORCE_TO;
+      kind = GOMP_MAP_FORCE_TO;
       break;
     case PRAGMA_OACC_CLAUSE_HOST:
     case PRAGMA_OACC_CLAUSE_SELF:
-      kind = OMP_CLAUSE_MAP_FORCE_FROM;
+      kind = GOMP_MAP_FORCE_FROM;
       break;
     case PRAGMA_OACC_CLAUSE_PRESENT:
-      kind = OMP_CLAUSE_MAP_FORCE_PRESENT;
+      kind = GOMP_MAP_FORCE_PRESENT;
       break;
     case PRAGMA_OACC_CLAUSE_PRESENT_OR_COPY:
-      kind = OMP_CLAUSE_MAP_TOFROM;
+      kind = GOMP_MAP_TOFROM;
       break;
     case PRAGMA_OACC_CLAUSE_PRESENT_OR_COPYIN:
-      kind = OMP_CLAUSE_MAP_TO;
+      kind = GOMP_MAP_TO;
       break;
     case PRAGMA_OACC_CLAUSE_PRESENT_OR_COPYOUT:
-      kind = OMP_CLAUSE_MAP_FROM;
+      kind = GOMP_MAP_FROM;
       break;
     case PRAGMA_OACC_CLAUSE_PRESENT_OR_CREATE:
-      kind = OMP_CLAUSE_MAP_ALLOC;
+      kind = GOMP_MAP_ALLOC;
       break;
     default:
       gcc_unreachable ();
@@ -27912,7 +27912,7 @@  cp_parser_oacc_data_clause_deviceptr (cp_parser *parser, tree list)
 	error_at (loc, "%qD is not a pointer variable", v);
 
       tree u = build_omp_clause (loc, OMP_CLAUSE_MAP);
-      OMP_CLAUSE_MAP_KIND (u) = OMP_CLAUSE_MAP_FORCE_DEVICEPTR;
+      OMP_CLAUSE_MAP_KIND (u) = GOMP_MAP_FORCE_DEVICEPTR;
       OMP_CLAUSE_DECL (u) = v;
       OMP_CLAUSE_CHAIN (u) = list;
       list = u;
@@ -28838,7 +28838,7 @@  static tree
 cp_parser_omp_clause_map (cp_parser *parser, tree list)
 {
   tree nlist, c;
-  enum omp_clause_map_kind kind = OMP_CLAUSE_MAP_TOFROM;
+  enum gomp_map_kind kind = GOMP_MAP_TOFROM;
 
   if (!cp_parser_require (parser, CPP_OPEN_PAREN, RT_OPEN_PAREN))
     return list;
@@ -28850,13 +28850,13 @@  cp_parser_omp_clause_map (cp_parser *parser, tree list)
       const char *p = IDENTIFIER_POINTER (id);
 
       if (strcmp ("alloc", p) == 0)
-	kind = OMP_CLAUSE_MAP_ALLOC;
+	kind = GOMP_MAP_ALLOC;
       else if (strcmp ("to", p) == 0)
-	kind = OMP_CLAUSE_MAP_TO;
+	kind = GOMP_MAP_TO;
       else if (strcmp ("from", p) == 0)
-	kind = OMP_CLAUSE_MAP_FROM;
+	kind = GOMP_MAP_FROM;
       else if (strcmp ("tofrom", p) == 0)
-	kind = OMP_CLAUSE_MAP_TOFROM;
+	kind = GOMP_MAP_TOFROM;
       else
 	{
 	  cp_parser_error (parser, "invalid map kind");
diff --git gcc/cp/semantics.c gcc/cp/semantics.c
index 28d3ae8..9691ed6 100644
--- gcc/cp/semantics.c
+++ gcc/cp/semantics.c
@@ -61,6 +61,7 @@  along with GCC; see the file COPYING3.  If not see
 #include "omp-low.h"
 #include "builtins.h"
 #include "convert.h"
+#include "gomp-constants.h"
 
 /* There routines provide a modular interface to perform many parsing
    operations.  They may therefore be used during actual parsing, or
@@ -4637,7 +4638,7 @@  handle_omp_array_sections (tree c)
 	    return false;
 	  tree c2 = build_omp_clause (OMP_CLAUSE_LOCATION (c),
 				      OMP_CLAUSE_MAP);
-	  OMP_CLAUSE_MAP_KIND (c2) = OMP_CLAUSE_MAP_POINTER;
+	  OMP_CLAUSE_MAP_KIND (c2) = GOMP_MAP_POINTER;
 	  if (!cxx_mark_addressable (t))
 	    return false;
 	  OMP_CLAUSE_DECL (c2) = t;
@@ -4661,7 +4662,7 @@  handle_omp_array_sections (tree c)
 	    {
 	      tree c3 = build_omp_clause (OMP_CLAUSE_LOCATION (c),
 					  OMP_CLAUSE_MAP);
-	      OMP_CLAUSE_MAP_KIND (c3) = OMP_CLAUSE_MAP_POINTER;
+	      OMP_CLAUSE_MAP_KIND (c3) = GOMP_MAP_POINTER;
 	      OMP_CLAUSE_DECL (c3) = ptr;
 	      OMP_CLAUSE_DECL (c2) = convert_from_reference (ptr);
 	      OMP_CLAUSE_SIZE (c3) = size_zero_node;
@@ -5753,7 +5754,7 @@  finish_omp_clauses (tree clauses)
 	      if (processing_template_decl)
 		break;
 	      if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_MAP
-		  && OMP_CLAUSE_MAP_KIND (c) == OMP_CLAUSE_MAP_POINTER)
+		  && OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_POINTER)
 		break;
 	      if (DECL_P (t))
 		error ("%qD is not a variable in %qs clause", t,
@@ -5774,7 +5775,7 @@  finish_omp_clauses (tree clauses)
 		   && !cxx_mark_addressable (t))
 	    remove = true;
 	  else if (!(OMP_CLAUSE_CODE (c) == OMP_CLAUSE_MAP
-		     && OMP_CLAUSE_MAP_KIND (c) == OMP_CLAUSE_MAP_POINTER)
+		     && OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_POINTER)
 		   && !type_dependent_expression_p (t)
 		   && !cp_omp_mappable_type ((TREE_CODE (TREE_TYPE (t))
 					      == REFERENCE_TYPE)
diff --git gcc/fortran/trans-openmp.c gcc/fortran/trans-openmp.c
index bdc00c8..3f77bc2 100644
--- gcc/fortran/trans-openmp.c
+++ gcc/fortran/trans-openmp.c
@@ -35,6 +35,7 @@  along with GCC; see the file COPYING3.  If not see
 #include "trans-const.h"
 #include "arith.h"
 #include "omp-low.h"
+#include "gomp-constants.h"
 
 int ompws_flags;
 
@@ -1034,7 +1035,7 @@  gfc_omp_finish_clause (tree c, gimple_seq *pre_p)
 	return;
       tree orig_decl = decl;
       c4 = build_omp_clause (OMP_CLAUSE_LOCATION (c), OMP_CLAUSE_MAP);
-      OMP_CLAUSE_MAP_KIND (c4) = OMP_CLAUSE_MAP_POINTER;
+      OMP_CLAUSE_MAP_KIND (c4) = GOMP_MAP_POINTER;
       OMP_CLAUSE_DECL (c4) = decl;
       OMP_CLAUSE_SIZE (c4) = size_int (0);
       decl = build_fold_indirect_ref (decl);
@@ -1045,7 +1046,7 @@  gfc_omp_finish_clause (tree c, gimple_seq *pre_p)
 	      || GFC_DECL_GET_SCALAR_ALLOCATABLE (orig_decl)))
 	{
 	  c3 = build_omp_clause (OMP_CLAUSE_LOCATION (c), OMP_CLAUSE_MAP);
-	  OMP_CLAUSE_MAP_KIND (c3) = OMP_CLAUSE_MAP_POINTER;
+	  OMP_CLAUSE_MAP_KIND (c3) = GOMP_MAP_POINTER;
 	  OMP_CLAUSE_DECL (c3) = unshare_expr (decl);
 	  OMP_CLAUSE_SIZE (c3) = size_int (0);
 	  decl = build_fold_indirect_ref (decl);
@@ -1062,11 +1063,11 @@  gfc_omp_finish_clause (tree c, gimple_seq *pre_p)
       ptr = build_fold_indirect_ref (ptr);
       OMP_CLAUSE_DECL (c) = ptr;
       c2 = build_omp_clause (input_location, OMP_CLAUSE_MAP);
-      OMP_CLAUSE_MAP_KIND (c2) = OMP_CLAUSE_MAP_TO_PSET;
+      OMP_CLAUSE_MAP_KIND (c2) = GOMP_MAP_TO_PSET;
       OMP_CLAUSE_DECL (c2) = decl;
       OMP_CLAUSE_SIZE (c2) = TYPE_SIZE_UNIT (type);
       c3 = build_omp_clause (OMP_CLAUSE_LOCATION (c), OMP_CLAUSE_MAP);
-      OMP_CLAUSE_MAP_KIND (c3) = OMP_CLAUSE_MAP_POINTER;
+      OMP_CLAUSE_MAP_KIND (c3) = GOMP_MAP_POINTER;
       OMP_CLAUSE_DECL (c3) = gfc_conv_descriptor_data_get (decl);
       OMP_CLAUSE_SIZE (c3) = size_int (0);
       tree size = create_tmp_var (gfc_array_index_type);
@@ -1942,7 +1943,7 @@  gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
 		      tree orig_decl = decl;
 		      node4 = build_omp_clause (input_location,
 						OMP_CLAUSE_MAP);
-		      OMP_CLAUSE_MAP_KIND (node4) = OMP_CLAUSE_MAP_POINTER;
+		      OMP_CLAUSE_MAP_KIND (node4) = GOMP_MAP_POINTER;
 		      OMP_CLAUSE_DECL (node4) = decl;
 		      OMP_CLAUSE_SIZE (node4) = size_int (0);
 		      decl = build_fold_indirect_ref (decl);
@@ -1952,7 +1953,7 @@  gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
 			{
 			  node3 = build_omp_clause (input_location,
 						    OMP_CLAUSE_MAP);
-			  OMP_CLAUSE_MAP_KIND (node3) = OMP_CLAUSE_MAP_POINTER;
+			  OMP_CLAUSE_MAP_KIND (node3) = GOMP_MAP_POINTER;
 			  OMP_CLAUSE_DECL (node3) = decl;
 			  OMP_CLAUSE_SIZE (node3) = size_int (0);
 			  decl = build_fold_indirect_ref (decl);
@@ -1968,12 +1969,12 @@  gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
 		      OMP_CLAUSE_DECL (node) = ptr;
 		      node2 = build_omp_clause (input_location,
 						OMP_CLAUSE_MAP);
-		      OMP_CLAUSE_MAP_KIND (node2) = OMP_CLAUSE_MAP_TO_PSET;
+		      OMP_CLAUSE_MAP_KIND (node2) = GOMP_MAP_TO_PSET;
 		      OMP_CLAUSE_DECL (node2) = decl;
 		      OMP_CLAUSE_SIZE (node2) = TYPE_SIZE_UNIT (type);
 		      node3 = build_omp_clause (input_location,
 						OMP_CLAUSE_MAP);
-		      OMP_CLAUSE_MAP_KIND (node3) = OMP_CLAUSE_MAP_POINTER;
+		      OMP_CLAUSE_MAP_KIND (node3) = GOMP_MAP_POINTER;
 		      OMP_CLAUSE_DECL (node3)
 			= gfc_conv_descriptor_data_get (decl);
 		      OMP_CLAUSE_SIZE (node3) = size_int (0);
@@ -2059,7 +2060,7 @@  gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
 		    {
 		      node4 = build_omp_clause (input_location,
 						OMP_CLAUSE_MAP);
-		      OMP_CLAUSE_MAP_KIND (node4) = OMP_CLAUSE_MAP_POINTER;
+		      OMP_CLAUSE_MAP_KIND (node4) = GOMP_MAP_POINTER;
 		      OMP_CLAUSE_DECL (node4) = decl;
 		      OMP_CLAUSE_SIZE (node4) = size_int (0);
 		      decl = build_fold_indirect_ref (decl);
@@ -2071,12 +2072,12 @@  gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
 		      ptr2 = gfc_conv_descriptor_data_get (decl);
 		      node2 = build_omp_clause (input_location,
 						OMP_CLAUSE_MAP);
-		      OMP_CLAUSE_MAP_KIND (node2) = OMP_CLAUSE_MAP_TO_PSET;
+		      OMP_CLAUSE_MAP_KIND (node2) = GOMP_MAP_TO_PSET;
 		      OMP_CLAUSE_DECL (node2) = decl;
 		      OMP_CLAUSE_SIZE (node2) = TYPE_SIZE_UNIT (type);
 		      node3 = build_omp_clause (input_location,
 						OMP_CLAUSE_MAP);
-		      OMP_CLAUSE_MAP_KIND (node3) = OMP_CLAUSE_MAP_POINTER;
+		      OMP_CLAUSE_MAP_KIND (node3) = GOMP_MAP_POINTER;
 		      OMP_CLAUSE_DECL (node3)
 			= gfc_conv_descriptor_data_get (decl);
 		    }
@@ -2091,7 +2092,7 @@  gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
 			}
 		      node3 = build_omp_clause (input_location,
 						OMP_CLAUSE_MAP);
-		      OMP_CLAUSE_MAP_KIND (node3) = OMP_CLAUSE_MAP_POINTER;
+		      OMP_CLAUSE_MAP_KIND (node3) = GOMP_MAP_POINTER;
 		      OMP_CLAUSE_DECL (node3) = decl;
 		    }
 		  ptr2 = fold_convert (sizetype, ptr2);
@@ -2101,37 +2102,37 @@  gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
 	      switch (n->u.map_op)
 		{
 		case OMP_MAP_ALLOC:
-		  OMP_CLAUSE_MAP_KIND (node) = OMP_CLAUSE_MAP_ALLOC;
+		  OMP_CLAUSE_MAP_KIND (node) = GOMP_MAP_ALLOC;
 		  break;
 		case OMP_MAP_TO:
-		  OMP_CLAUSE_MAP_KIND (node) = OMP_CLAUSE_MAP_TO;
+		  OMP_CLAUSE_MAP_KIND (node) = GOMP_MAP_TO;
 		  break;
 		case OMP_MAP_FROM:
-		  OMP_CLAUSE_MAP_KIND (node) = OMP_CLAUSE_MAP_FROM;
+		  OMP_CLAUSE_MAP_KIND (node) = GOMP_MAP_FROM;
 		  break;
 		case OMP_MAP_TOFROM:
-		  OMP_CLAUSE_MAP_KIND (node) = OMP_CLAUSE_MAP_TOFROM;
+		  OMP_CLAUSE_MAP_KIND (node) = GOMP_MAP_TOFROM;
 		  break;
 		case OMP_MAP_FORCE_ALLOC:
-		  OMP_CLAUSE_MAP_KIND (node) = OMP_CLAUSE_MAP_FORCE_ALLOC;
+		  OMP_CLAUSE_MAP_KIND (node) = GOMP_MAP_FORCE_ALLOC;
 		  break;
 		case OMP_MAP_FORCE_DEALLOC:
-		  OMP_CLAUSE_MAP_KIND (node) = OMP_CLAUSE_MAP_FORCE_DEALLOC;
+		  OMP_CLAUSE_MAP_KIND (node) = GOMP_MAP_FORCE_DEALLOC;
 		  break;
 		case OMP_MAP_FORCE_TO:
-		  OMP_CLAUSE_MAP_KIND (node) = OMP_CLAUSE_MAP_FORCE_TO;
+		  OMP_CLAUSE_MAP_KIND (node) = GOMP_MAP_FORCE_TO;
 		  break;
 		case OMP_MAP_FORCE_FROM:
-		  OMP_CLAUSE_MAP_KIND (node) = OMP_CLAUSE_MAP_FORCE_FROM;
+		  OMP_CLAUSE_MAP_KIND (node) = GOMP_MAP_FORCE_FROM;
 		  break;
 		case OMP_MAP_FORCE_TOFROM:
-		  OMP_CLAUSE_MAP_KIND (node) = OMP_CLAUSE_MAP_FORCE_TOFROM;
+		  OMP_CLAUSE_MAP_KIND (node) = GOMP_MAP_FORCE_TOFROM;
 		  break;
 		case OMP_MAP_FORCE_PRESENT:
-		  OMP_CLAUSE_MAP_KIND (node) = OMP_CLAUSE_MAP_FORCE_PRESENT;
+		  OMP_CLAUSE_MAP_KIND (node) = GOMP_MAP_FORCE_PRESENT;
 		  break;
 		case OMP_MAP_FORCE_DEVICEPTR:
-		  OMP_CLAUSE_MAP_KIND (node) = OMP_CLAUSE_MAP_FORCE_DEVICEPTR;
+		  OMP_CLAUSE_MAP_KIND (node) = GOMP_MAP_FORCE_DEVICEPTR;
 		  break;
 		default:
 		  gcc_unreachable ();
diff --git gcc/gimplify.c gcc/gimplify.c
index 6972def..4b574da 100644
--- gcc/gimplify.c
+++ gcc/gimplify.c
@@ -70,6 +70,7 @@  along with GCC; see the file COPYING3.  If not see
 #include "omp-low.h"
 #include "gimple-low.h"
 #include "cilk.h"
+#include "gomp-constants.h"
 
 #include "langhooks-def.h"	/* FIXME: for lhd_set_decl_assembler_name */
 #include "tree-pass.h"		/* FIXME: only for PROP_gimple_any */
@@ -6436,8 +6437,8 @@  gimplify_adjust_omp_clauses_1 (splay_tree_node n, void *data)
   else if (code == OMP_CLAUSE_MAP)
     {
       OMP_CLAUSE_MAP_KIND (clause) = flags & GOVD_MAP_TO_ONLY
-				     ? OMP_CLAUSE_MAP_TO
-				     : OMP_CLAUSE_MAP_TOFROM;
+				     ? GOMP_MAP_TO
+				     : GOMP_MAP_TOFROM;
       if (DECL_SIZE (decl)
 	  && TREE_CODE (DECL_SIZE (decl)) != INTEGER_CST)
 	{
@@ -6458,7 +6459,7 @@  gimplify_adjust_omp_clauses_1 (splay_tree_node n, void *data)
 				      OMP_CLAUSE_MAP);
 	  OMP_CLAUSE_DECL (nc) = decl;
 	  OMP_CLAUSE_SIZE (nc) = size_zero_node;
-	  OMP_CLAUSE_MAP_KIND (nc) = OMP_CLAUSE_MAP_POINTER;
+	  OMP_CLAUSE_MAP_KIND (nc) = GOMP_MAP_POINTER;
 	  OMP_CLAUSE_CHAIN (nc) = OMP_CLAUSE_CHAIN (clause);
 	  OMP_CLAUSE_CHAIN (clause) = nc;
 	}
@@ -6608,13 +6609,12 @@  gimplify_adjust_omp_clauses (gimple_seq *pre_p, tree *list_p)
 	    remove = true;
 	  else if (DECL_SIZE (decl)
 		   && TREE_CODE (DECL_SIZE (decl)) != INTEGER_CST
-		   && OMP_CLAUSE_MAP_KIND (c) != OMP_CLAUSE_MAP_POINTER)
+		   && OMP_CLAUSE_MAP_KIND (c) != GOMP_MAP_POINTER)
 	    {
-	      /* For OMP_CLAUSE_MAP_FORCE_DEVICEPTR, we'll never enter here,
-		 because for these, TREE_CODE (DECL_SIZE (decl)) will always be
+	      /* For GOMP_MAP_FORCE_DEVICEPTR, we'll never enter here, because
+		 for these, TREE_CODE (DECL_SIZE (decl)) will always be
 		 INTEGER_CST.  */
-	      gcc_assert (OMP_CLAUSE_MAP_KIND (c)
-			  != OMP_CLAUSE_MAP_FORCE_DEVICEPTR);
+	      gcc_assert (OMP_CLAUSE_MAP_KIND (c) != GOMP_MAP_FORCE_DEVICEPTR);
 
 	      tree decl2 = DECL_VALUE_EXPR (decl);
 	      gcc_assert (TREE_CODE (decl2) == INDIRECT_REF);
@@ -6633,7 +6633,7 @@  gimplify_adjust_omp_clauses (gimple_seq *pre_p, tree *list_p)
 					  OMP_CLAUSE_MAP);
 	      OMP_CLAUSE_DECL (nc) = decl;
 	      OMP_CLAUSE_SIZE (nc) = size_zero_node;
-	      OMP_CLAUSE_MAP_KIND (nc) = OMP_CLAUSE_MAP_POINTER;
+	      OMP_CLAUSE_MAP_KIND (nc) = GOMP_MAP_POINTER;
 	      OMP_CLAUSE_CHAIN (nc) = OMP_CLAUSE_CHAIN (c);
 	      OMP_CLAUSE_CHAIN (c) = nc;
 	      c = nc;
diff --git gcc/omp-low.c gcc/omp-low.c
index 1395f24..5dd540b 100644
--- gcc/omp-low.c
+++ gcc/omp-low.c
@@ -1836,11 +1836,10 @@  scan_sharing_clauses (tree clauses, omp_context *ctx)
 	      && varpool_node::get_create (decl)->offloadable)
 	    break;
 	  if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_MAP
-	      && OMP_CLAUSE_MAP_KIND (c) == OMP_CLAUSE_MAP_POINTER)
+	      && OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_POINTER)
 	    {
-	      /* Ignore OMP_CLAUSE_MAP_POINTER kind for arrays in
-		 regions that are not offloaded; there is nothing to map for
-		 those.  */
+	      /* Ignore GOMP_MAP_POINTER kind for arrays in regions that are
+		 not offloaded; there is nothing to map for those.  */
 	      if (!is_gimple_omp_offloaded (ctx->stmt)
 		  && !POINTER_TYPE_P (TREE_TYPE (decl)))
 		break;
@@ -1861,7 +1860,7 @@  scan_sharing_clauses (tree clauses, omp_context *ctx)
 	      else
 		{
 		  if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_MAP
-		      && OMP_CLAUSE_MAP_KIND (c) == OMP_CLAUSE_MAP_POINTER
+		      && OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_POINTER
 		      && !OMP_CLAUSE_MAP_ZERO_BIAS_ARRAY_SECTION (c)
 		      && TREE_CODE (TREE_TYPE (decl)) == ARRAY_TYPE)
 		    install_var_field (decl, true, 7, ctx);
@@ -1879,7 +1878,7 @@  scan_sharing_clauses (tree clauses, omp_context *ctx)
 		  && nc != NULL_TREE
 		  && OMP_CLAUSE_CODE (nc) == OMP_CLAUSE_MAP
 		  && OMP_CLAUSE_DECL (nc) == base
-		  && OMP_CLAUSE_MAP_KIND (nc) == OMP_CLAUSE_MAP_POINTER
+		  && OMP_CLAUSE_MAP_KIND (nc) == GOMP_MAP_POINTER
 		  && integer_zerop (OMP_CLAUSE_SIZE (nc)))
 		{
 		  OMP_CLAUSE_MAP_ZERO_BIAS_ARRAY_SECTION (c) = 1;
@@ -1996,7 +1995,7 @@  scan_sharing_clauses (tree clauses, omp_context *ctx)
 	    break;
 	  if (DECL_P (decl))
 	    {
-	      if (OMP_CLAUSE_MAP_KIND (c) == OMP_CLAUSE_MAP_POINTER
+	      if (OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_POINTER
 		  && TREE_CODE (TREE_TYPE (decl)) == ARRAY_TYPE
 		  && !COMPLETE_TYPE_P (TREE_TYPE (decl)))
 		{
@@ -9707,7 +9706,7 @@  oacc_initialize_reduction_data (tree clauses, tree nthreads,
       /* Add the reduction array to the list of clauses.  */
       tree x = array;
       t = build_omp_clause (gimple_location (ctx->stmt), OMP_CLAUSE_MAP);
-      OMP_CLAUSE_MAP_KIND (t) = OMP_CLAUSE_MAP_FORCE_FROM;
+      OMP_CLAUSE_MAP_KIND (t) = GOMP_MAP_FORCE_FROM;
       OMP_CLAUSE_DECL (t) = x;
       OMP_CLAUSE_CHAIN (t) = NULL;
       if (oc)
@@ -11229,20 +11228,20 @@  lower_omp_target (gimple_stmt_iterator *gsi_p, omp_context *ctx)
 	/* First check what we're prepared to handle in the following.  */
 	switch (OMP_CLAUSE_MAP_KIND (c))
 	  {
-	  case OMP_CLAUSE_MAP_ALLOC:
-	  case OMP_CLAUSE_MAP_TO:
-	  case OMP_CLAUSE_MAP_FROM:
-	  case OMP_CLAUSE_MAP_TOFROM:
-	  case OMP_CLAUSE_MAP_POINTER:
-	  case OMP_CLAUSE_MAP_TO_PSET:
+	  case GOMP_MAP_ALLOC:
+	  case GOMP_MAP_TO:
+	  case GOMP_MAP_FROM:
+	  case GOMP_MAP_TOFROM:
+	  case GOMP_MAP_POINTER:
+	  case GOMP_MAP_TO_PSET:
 	    break;
-	  case OMP_CLAUSE_MAP_FORCE_ALLOC:
-	  case OMP_CLAUSE_MAP_FORCE_TO:
-	  case OMP_CLAUSE_MAP_FORCE_FROM:
-	  case OMP_CLAUSE_MAP_FORCE_TOFROM:
-	  case OMP_CLAUSE_MAP_FORCE_PRESENT:
-	  case OMP_CLAUSE_MAP_FORCE_DEALLOC:
-	  case OMP_CLAUSE_MAP_FORCE_DEVICEPTR:
+	  case GOMP_MAP_FORCE_ALLOC:
+	  case GOMP_MAP_FORCE_TO:
+	  case GOMP_MAP_FORCE_FROM:
+	  case GOMP_MAP_FORCE_TOFROM:
+	  case GOMP_MAP_FORCE_PRESENT:
+	  case GOMP_MAP_FORCE_DEALLOC:
+	  case GOMP_MAP_FORCE_DEVICEPTR:
 	    gcc_assert (is_gimple_omp_oacc (stmt));
 	    break;
 	  default:
@@ -11278,7 +11277,7 @@  lower_omp_target (gimple_stmt_iterator *gsi_p, omp_context *ctx)
 	  {
 	    x = build_receiver_ref (var, true, ctx);
 	    tree new_var = lookup_decl (var, ctx);
-	    if (OMP_CLAUSE_MAP_KIND (c) == OMP_CLAUSE_MAP_POINTER
+	    if (OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_POINTER
 		&& !OMP_CLAUSE_MAP_ZERO_BIAS_ARRAY_SECTION (c)
 		&& TREE_CODE (TREE_TYPE (var)) == ARRAY_TYPE)
 	      x = build_simple_mem_ref (x);
@@ -11407,7 +11406,7 @@  lower_omp_target (gimple_stmt_iterator *gsi_p, omp_context *ctx)
 		    gimplify_assign (x, var, &ilist);
 		  }
 		else if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_MAP
-			 && OMP_CLAUSE_MAP_KIND (c) == OMP_CLAUSE_MAP_POINTER
+			 && OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_POINTER
 			 && !OMP_CLAUSE_MAP_ZERO_BIAS_ARRAY_SECTION (c)
 			 && TREE_CODE (TREE_TYPE (ovar)) == ARRAY_TYPE)
 		  {
@@ -11425,17 +11424,16 @@  lower_omp_target (gimple_stmt_iterator *gsi_p, omp_context *ctx)
 		    gcc_assert (offloaded);
 		    tree avar = create_tmp_var (TREE_TYPE (var));
 		    mark_addressable (avar);
-		    enum omp_clause_map_kind map_kind
-		      = OMP_CLAUSE_MAP_KIND (c);
+		    enum gomp_map_kind map_kind = OMP_CLAUSE_MAP_KIND (c);
 		    if (GOMP_MAP_COPY_TO_P (map_kind)
-			|| map_kind == OMP_CLAUSE_MAP_POINTER
-			|| map_kind == OMP_CLAUSE_MAP_TO_PSET
-			|| map_kind == OMP_CLAUSE_MAP_FORCE_DEVICEPTR)
+			|| map_kind == GOMP_MAP_POINTER
+			|| map_kind == GOMP_MAP_TO_PSET
+			|| map_kind == GOMP_MAP_FORCE_DEVICEPTR)
 		      gimplify_assign (avar, var, &ilist);
 		    avar = build_fold_addr_expr (avar);
 		    gimplify_assign (x, avar, &ilist);
 		    if ((GOMP_MAP_COPY_FROM_P (map_kind)
-			 || map_kind == OMP_CLAUSE_MAP_FORCE_DEVICEPTR)
+			 || map_kind == GOMP_MAP_FORCE_DEVICEPTR)
 			&& !TYPE_READONLY (TREE_TYPE (var)))
 		      {
 			x = build_sender_ref (ovar, ctx);
@@ -11465,10 +11463,10 @@  lower_omp_target (gimple_stmt_iterator *gsi_p, omp_context *ctx)
 		tkind = OMP_CLAUSE_MAP_KIND (c);
 		break;
 	      case OMP_CLAUSE_TO:
-		tkind = OMP_CLAUSE_MAP_TO;
+		tkind = GOMP_MAP_TO;
 		break;
 	      case OMP_CLAUSE_FROM:
-		tkind = OMP_CLAUSE_MAP_FROM;
+		tkind = GOMP_MAP_FROM;
 		break;
 	      default:
 		gcc_unreachable ();
diff --git gcc/tree-core.h gcc/tree-core.h
index 66e6b5a..f22d4f9 100644
--- gcc/tree-core.h
+++ gcc/tree-core.h
@@ -1239,45 +1239,8 @@  enum omp_clause_depend_kind
   OMP_CLAUSE_DEPEND_LAST
 };
 
-enum omp_clause_map_kind
-{
-  /* If not already present, allocate.  */
-  OMP_CLAUSE_MAP_ALLOC = GOMP_MAP_ALLOC,
-  /* ..., and copy to device.  */
-  OMP_CLAUSE_MAP_TO = GOMP_MAP_TO,
-  /* ..., and copy from device.  */
-  OMP_CLAUSE_MAP_FROM = GOMP_MAP_FROM,
-  /* ..., and copy to and from device.  */
-  OMP_CLAUSE_MAP_TOFROM = GOMP_MAP_TOFROM,
-  /* The following kind is an internal only map kind, used for pointer based
-     array sections.  OMP_CLAUSE_SIZE for these is not the pointer size,
-     which is implicitly POINTER_SIZE_UNITS, but the bias.  */
-  OMP_CLAUSE_MAP_POINTER = GOMP_MAP_POINTER,
-  /* Also internal, behaves like OMP_CLAUS_MAP_TO, but additionally any
-     OMP_CLAUSE_MAP_POINTER records consecutive after it which have addresses
-     falling into that range will not be ignored if OMP_CLAUSE_MAP_TO_PSET
-     wasn't mapped already.  */
-  OMP_CLAUSE_MAP_TO_PSET = GOMP_MAP_TO_PSET,
-  /* The following are only valid for OpenACC.  */
-  /* Allocate.  */
-  OMP_CLAUSE_MAP_FORCE_ALLOC = GOMP_MAP_FORCE_ALLOC,
-  /* ..., and copy to device.  */
-  OMP_CLAUSE_MAP_FORCE_TO = GOMP_MAP_FORCE_TO,
-  /* ..., and copy from device.  */
-  OMP_CLAUSE_MAP_FORCE_FROM = GOMP_MAP_FORCE_FROM,
-  /* ..., and copy to and from device.  */
-  OMP_CLAUSE_MAP_FORCE_TOFROM = GOMP_MAP_FORCE_TOFROM,
-  /* Must already be present.  */
-  OMP_CLAUSE_MAP_FORCE_PRESENT = GOMP_MAP_FORCE_PRESENT,
-  /* Deallocate a mapping, without copying from device.  */
-  OMP_CLAUSE_MAP_FORCE_DEALLOC = GOMP_MAP_FORCE_DEALLOC,
-  /* Is a device pointer.  OMP_CLAUSE_SIZE for these is unused; is implicitly
-     POINTER_SIZE_UNITS.  */
-  OMP_CLAUSE_MAP_FORCE_DEVICEPTR = GOMP_MAP_FORCE_DEVICEPTR,
-
-  /* End marker.  */
-  OMP_CLAUSE_MAP_LAST = GOMP_MAP_VALUE_LIMIT
-};
+/* See include/gomp-constants.h.  */
+enum gomp_map_kind;
 
 enum omp_clause_proc_bind_kind
 {
@@ -1350,7 +1313,7 @@  struct GTY(()) tree_omp_clause {
     enum omp_clause_default_kind   default_kind;
     enum omp_clause_schedule_kind  schedule_kind;
     enum omp_clause_depend_kind    depend_kind;
-    enum omp_clause_map_kind       map_kind;
+    enum gomp_map_kind		   map_kind;
     enum omp_clause_proc_bind_kind proc_bind_kind;
     enum tree_code                 reduction_code;
   } GTY ((skip)) subcode;
diff --git gcc/tree-nested.c gcc/tree-nested.c
index 6a3e587..714375d 100644
--- gcc/tree-nested.c
+++ gcc/tree-nested.c
@@ -54,6 +54,7 @@ 
 #include "expr.h"	/* FIXME: For STACK_SAVEAREA_MODE and SAVE_NONLOCAL.  */
 #include "langhooks.h"
 #include "gimple-low.h"
+#include "gomp-constants.h"
 
 
 /* The object of this pass is to lower the representation of a set of nested
@@ -1399,7 +1400,7 @@  convert_nonlocal_reference_stmt (gimple_stmt_iterator *gsi, bool *handled_ops_p,
 	  decl = get_chain_decl (info);
 	  c = build_omp_clause (gimple_location (stmt), OMP_CLAUSE_MAP);
 	  OMP_CLAUSE_DECL (c) = decl;
-	  OMP_CLAUSE_MAP_KIND (c) = OMP_CLAUSE_MAP_TO;
+	  OMP_CLAUSE_MAP_KIND (c) = GOMP_MAP_TO;
 	  OMP_CLAUSE_SIZE (c) = DECL_SIZE_UNIT (decl);
 	  OMP_CLAUSE_CHAIN (c) = gimple_omp_target_clauses (stmt);
 	  gimple_omp_target_set_clauses (as_a <gomp_target *> (stmt), c);
@@ -1965,7 +1966,7 @@  convert_local_reference_stmt (gimple_stmt_iterator *gsi, bool *handled_ops_p,
 	  (void) get_frame_type (info);
 	  c = build_omp_clause (gimple_location (stmt), OMP_CLAUSE_MAP);
 	  OMP_CLAUSE_DECL (c) = info->frame_decl;
-	  OMP_CLAUSE_MAP_KIND (c) = OMP_CLAUSE_MAP_TOFROM;
+	  OMP_CLAUSE_MAP_KIND (c) = GOMP_MAP_TOFROM;
 	  OMP_CLAUSE_SIZE (c) = DECL_SIZE_UNIT (info->frame_decl);
 	  OMP_CLAUSE_CHAIN (c) = gimple_omp_target_clauses (stmt);
 	  gimple_omp_target_set_clauses (as_a <gomp_target *> (stmt), c);
@@ -2406,8 +2407,7 @@  convert_gimple_call (gimple_stmt_iterator *gsi, bool *handled_ops_p,
 	    {
 	      c = build_omp_clause (gimple_location (stmt), OMP_CLAUSE_MAP);
 	      OMP_CLAUSE_DECL (c) = decl;
-	      OMP_CLAUSE_MAP_KIND (c)
-		= i ? OMP_CLAUSE_MAP_TO : OMP_CLAUSE_MAP_TOFROM;
+	      OMP_CLAUSE_MAP_KIND (c) = i ? GOMP_MAP_TO : GOMP_MAP_TOFROM;
 	      OMP_CLAUSE_SIZE (c) = DECL_SIZE_UNIT (decl);
 	      OMP_CLAUSE_CHAIN (c) = gimple_omp_target_clauses (stmt);
 	      gimple_omp_target_set_clauses (as_a <gomp_target *> (stmt),
diff --git gcc/tree-pretty-print.c gcc/tree-pretty-print.c
index 80ab17a..52588ac 100644
--- gcc/tree-pretty-print.c
+++ gcc/tree-pretty-print.c
@@ -47,6 +47,7 @@  along with GCC; see the file COPYING3.  If not see
 #include "value-prof.h"
 #include "wide-int-print.h"
 #include "internal-fn.h"
+#include "gomp-constants.h"
 
 /* Local functions, macros and variables.  */
 static const char *op_symbol (const_tree);
@@ -516,39 +517,39 @@  dump_omp_clause (pretty_printer *pp, tree clause, int spc, int flags)
       pp_string (pp, "map(");
       switch (OMP_CLAUSE_MAP_KIND (clause))
 	{
-	case OMP_CLAUSE_MAP_ALLOC:
-	case OMP_CLAUSE_MAP_POINTER:
+	case GOMP_MAP_ALLOC:
+	case GOMP_MAP_POINTER:
 	  pp_string (pp, "alloc");
 	  break;
-	case OMP_CLAUSE_MAP_TO:
-	case OMP_CLAUSE_MAP_TO_PSET:
+	case GOMP_MAP_TO:
+	case GOMP_MAP_TO_PSET:
 	  pp_string (pp, "to");
 	  break;
-	case OMP_CLAUSE_MAP_FROM:
+	case GOMP_MAP_FROM:
 	  pp_string (pp, "from");
 	  break;
-	case OMP_CLAUSE_MAP_TOFROM:
+	case GOMP_MAP_TOFROM:
 	  pp_string (pp, "tofrom");
 	  break;
-	case OMP_CLAUSE_MAP_FORCE_ALLOC:
+	case GOMP_MAP_FORCE_ALLOC:
 	  pp_string (pp, "force_alloc");
 	  break;
-	case OMP_CLAUSE_MAP_FORCE_TO:
+	case GOMP_MAP_FORCE_TO:
 	  pp_string (pp, "force_to");
 	  break;
-	case OMP_CLAUSE_MAP_FORCE_FROM:
+	case GOMP_MAP_FORCE_FROM:
 	  pp_string (pp, "force_from");
 	  break;
-	case OMP_CLAUSE_MAP_FORCE_TOFROM:
+	case GOMP_MAP_FORCE_TOFROM:
 	  pp_string (pp, "force_tofrom");
 	  break;
-	case OMP_CLAUSE_MAP_FORCE_PRESENT:
+	case GOMP_MAP_FORCE_PRESENT:
 	  pp_string (pp, "force_present");
 	  break;
-	case OMP_CLAUSE_MAP_FORCE_DEALLOC:
+	case GOMP_MAP_FORCE_DEALLOC:
 	  pp_string (pp, "force_dealloc");
 	  break;
-	case OMP_CLAUSE_MAP_FORCE_DEVICEPTR:
+	case GOMP_MAP_FORCE_DEVICEPTR:
 	  pp_string (pp, "force_deviceptr");
 	  break;
 	default:
@@ -561,10 +562,10 @@  dump_omp_clause (pretty_printer *pp, tree clause, int spc, int flags)
       if (OMP_CLAUSE_SIZE (clause))
 	{
 	  if (OMP_CLAUSE_CODE (clause) == OMP_CLAUSE_MAP
-	      && OMP_CLAUSE_MAP_KIND (clause) == OMP_CLAUSE_MAP_POINTER)
+	      && OMP_CLAUSE_MAP_KIND (clause) == GOMP_MAP_POINTER)
 	    pp_string (pp, " [pointer assign, bias: ");
 	  else if (OMP_CLAUSE_CODE (clause) == OMP_CLAUSE_MAP
-		   && OMP_CLAUSE_MAP_KIND (clause) == OMP_CLAUSE_MAP_TO_PSET)
+		   && OMP_CLAUSE_MAP_KIND (clause) == GOMP_MAP_TO_PSET)
 	    pp_string (pp, " [pointer set, len: ");
 	  else
 	    pp_string (pp, " [len: ");
diff --git gcc/tree-streamer-in.c gcc/tree-streamer-in.c
index eb205ed..cf05ed4 100644
--- gcc/tree-streamer-in.c
+++ gcc/tree-streamer-in.c
@@ -427,7 +427,7 @@  unpack_ts_omp_clause_value_fields (struct data_in *data_in,
       break;
     case OMP_CLAUSE_MAP:
       OMP_CLAUSE_MAP_KIND (expr)
-	= bp_unpack_enum (bp, omp_clause_map_kind, OMP_CLAUSE_MAP_LAST);
+	= bp_unpack_enum (bp, gomp_map_kind, GOMP_MAP_LAST);
       break;
     case OMP_CLAUSE_PROC_BIND:
       OMP_CLAUSE_PROC_BIND_KIND (expr)
diff --git gcc/tree-streamer-out.c gcc/tree-streamer-out.c
index 0d87cff..80cf9bb 100644
--- gcc/tree-streamer-out.c
+++ gcc/tree-streamer-out.c
@@ -387,7 +387,7 @@  pack_ts_omp_clause_value_fields (struct output_block *ob,
 		    OMP_CLAUSE_DEPEND_KIND (expr));
       break;
     case OMP_CLAUSE_MAP:
-      bp_pack_enum (bp, omp_clause_map_kind, OMP_CLAUSE_MAP_LAST,
+      bp_pack_enum (bp, gomp_map_kind, GOMP_MAP_LAST,
 		    OMP_CLAUSE_MAP_KIND (expr));
       break;
     case OMP_CLAUSE_PROC_BIND:
diff --git gcc/tree.h gcc/tree.h
index 41be2c8..70a4169 100644
--- gcc/tree.h
+++ gcc/tree.h
@@ -1402,8 +1402,8 @@  extern void protected_set_expr_location (tree, location_t);
   (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_MAP)->omp_clause.subcode.map_kind)
 
 /* Nonzero if this map clause is for array (rather than pointer) based array
-   section with zero bias.  Both the non-decl OMP_CLAUSE_MAP and
-   correspoidng OMP_CLAUSE_MAP_POINTER clause are marked with this flag.  */
+   section with zero bias.  Both the non-decl OMP_CLAUSE_MAP and corresponding
+   OMP_CLAUSE_MAP with GOMP_MAP_POINTER are marked with this flag.  */
 #define OMP_CLAUSE_MAP_ZERO_BIAS_ARRAY_SECTION(NODE) \
   (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_MAP)->base.public_flag)
 
diff --git include/gomp-constants.h include/gomp-constants.h
index b5f8d88..ff0dd14 100644
--- include/gomp-constants.h
+++ include/gomp-constants.h
@@ -32,7 +32,7 @@ 
 /* Memory mapping types.  */
 
 /* One byte.  */
-#define GOMP_MAP_VALUE_LIMIT		(1 << 8)
+#define GOMP_MAP_LAST			(1 << 8)
 
 #define GOMP_MAP_FLAG_TO		(1 << 0)
 #define GOMP_MAP_FLAG_FROM		(1 << 1)
@@ -44,19 +44,41 @@ 
 /* Flag to force a specific behavior (or else, trigger a run-time error).  */
 #define GOMP_MAP_FLAG_FORCE		(1 << 7)
 
-#define GOMP_MAP_ALLOC			0
-#define GOMP_MAP_TO			(GOMP_MAP_ALLOC | GOMP_MAP_FLAG_TO)
-#define GOMP_MAP_FROM			(GOMP_MAP_ALLOC | GOMP_MAP_FLAG_FROM)
-#define GOMP_MAP_TOFROM			(GOMP_MAP_TO | GOMP_MAP_FROM)
-#define GOMP_MAP_POINTER		(GOMP_MAP_FLAG_SPECIAL_0 | 0)
-#define GOMP_MAP_TO_PSET		(GOMP_MAP_FLAG_SPECIAL_0 | 1)
-#define GOMP_MAP_FORCE_PRESENT		(GOMP_MAP_FLAG_SPECIAL_0 | 2)
-#define GOMP_MAP_FORCE_DEALLOC		(GOMP_MAP_FLAG_SPECIAL_0 | 3)
-#define GOMP_MAP_FORCE_DEVICEPTR	(GOMP_MAP_FLAG_SPECIAL_1 | 0)
-#define GOMP_MAP_FORCE_ALLOC		(GOMP_MAP_FLAG_FORCE | GOMP_MAP_ALLOC)
-#define GOMP_MAP_FORCE_TO		(GOMP_MAP_FLAG_FORCE | GOMP_MAP_TO)
-#define GOMP_MAP_FORCE_FROM		(GOMP_MAP_FLAG_FORCE | GOMP_MAP_FROM)
-#define GOMP_MAP_FORCE_TOFROM		(GOMP_MAP_FLAG_FORCE | GOMP_MAP_TOFROM)
+enum gomp_map_kind
+  {
+    /* If not already present, allocate.  */
+    GOMP_MAP_ALLOC =			0,
+    /* ..., and copy to device.  */
+    GOMP_MAP_TO =			(GOMP_MAP_ALLOC | GOMP_MAP_FLAG_TO),
+    /* ..., and copy from device.  */
+    GOMP_MAP_FROM =			(GOMP_MAP_ALLOC | GOMP_MAP_FLAG_FROM),
+    /* ..., and copy to and from device.  */
+    GOMP_MAP_TOFROM =			(GOMP_MAP_TO | GOMP_MAP_FROM),
+    /* The following kind is an internal only map kind, used for pointer based
+       array sections.  OMP_CLAUSE_SIZE for these is not the pointer size,
+       which is implicitly POINTER_SIZE_UNITS, but the bias.  */
+    GOMP_MAP_POINTER =			(GOMP_MAP_FLAG_SPECIAL_0 | 0),
+    /* Also internal, behaves like GOMP_MAP_TO, but additionally any
+       GOMP_MAP_POINTER records consecutive after it which have addresses
+       falling into that range will not be ignored if GOMP_MAP_TO_PSET wasn't
+       mapped already.  */
+    GOMP_MAP_TO_PSET =			(GOMP_MAP_FLAG_SPECIAL_0 | 1),
+    /* Must already be present.  */
+    GOMP_MAP_FORCE_PRESENT =		(GOMP_MAP_FLAG_SPECIAL_0 | 2),
+    /* Deallocate a mapping, without copying from device.  */
+    GOMP_MAP_FORCE_DEALLOC =		(GOMP_MAP_FLAG_SPECIAL_0 | 3),
+    /* Is a device pointer.  OMP_CLAUSE_SIZE for these is unused; is implicitly
+       POINTER_SIZE_UNITS.  */
+    GOMP_MAP_FORCE_DEVICEPTR =		(GOMP_MAP_FLAG_SPECIAL_1 | 0),
+    /* Allocate.  */
+    GOMP_MAP_FORCE_ALLOC =		(GOMP_MAP_FLAG_FORCE | GOMP_MAP_ALLOC),
+    /* ..., and copy to device.  */
+    GOMP_MAP_FORCE_TO =			(GOMP_MAP_FLAG_FORCE | GOMP_MAP_TO),
+    /* ..., and copy from device.  */
+    GOMP_MAP_FORCE_FROM =		(GOMP_MAP_FLAG_FORCE | GOMP_MAP_FROM),
+    /* ..., and copy to and from device.  */
+    GOMP_MAP_FORCE_TOFROM =		(GOMP_MAP_FLAG_FORCE | GOMP_MAP_TOFROM)
+  };
 
 #define GOMP_MAP_COPY_TO_P(X) \
   (!((X) & GOMP_MAP_FLAG_SPECIAL) \