Hi!

On Tue, 14 Jan 2014 16:10:07 +0100, I wrote:
>       gcc/c-family/
>       * c-pragma.h (pragma_omp_clause): Add PRAGMA_OMP_CLAUSE_COPY,
>       PRAGMA_OMP_CLAUSE_COPYOUT, PRAGMA_OMP_CLAUSE_CREATE,
>       PRAGMA_OMP_CLAUSE_DELETE, PRAGMA_OMP_CLAUSE_DEVICEPTR,
>       PRAGMA_OMP_CLAUSE_PRESENT, PRAGMA_OMP_CLAUSE_PRESENT_OR_COPY,
>       PRAGMA_OMP_CLAUSE_PRESENT_OR_COPYIN,
>       PRAGMA_OMP_CLAUSE_PRESENT_OR_COPYOUT, and
>       PRAGMA_OMP_CLAUSE_PRESENT_OR_CREATE.
>       gcc/c/
>       * c-parser.c (c_parser_omp_clause_name): Handle these.
>       (c_parser_oacc_data_clause, c_parser_oacc_data_clause_deviceptr):
>       New functions.
>       (c_parser_oacc_all_clauses): Handle PRAGMA_OMP_CLAUSE_COPY,
>       PRAGMA_OMP_CLAUSE_COPYIN, PRAGMA_OMP_CLAUSE_COPYOUT,
>       PRAGMA_OMP_CLAUSE_CREATE, PRAGMA_OMP_CLAUSE_DELETE,
>       PRAGMA_OMP_CLAUSE_DEVICEPTR, PRAGMA_OMP_CLAUSE_PRESENT,
>       PRAGMA_OMP_CLAUSE_PRESENT_OR_COPY,
>       PRAGMA_OMP_CLAUSE_PRESENT_OR_COPYIN,
>       PRAGMA_OMP_CLAUSE_PRESENT_OR_COPYOUT, and
>       PRAGMA_OMP_CLAUSE_PRESENT_OR_CREATE.
>       gcc/
>       * tree-core.h (omp_clause_code): Update description for
>       OMP_CLAUSE_MAP.

This I committed to gomp-4_0-branch as r207177.

In
<http://news.gmane.org/find-root.php?message_id=%3C52E68AE3.9030706%40samsung.com%3E>,
Ilmir mentioned that I'm missing to handle the »short names: pcopy,
pcopyin, pcopyout and pcreate (see 2.6.5.9 - 2.6.5.12 of OpenACC 2.0«.
Unless there are any comments, I'll soon commit the following to
gomp-4_0-branch:

commit 9a1f6c075f6198c9ae3281387b875e6012e4387e
Author: Thomas Schwinge <tho...@codesourcery.com>
Date:   Wed Feb 12 11:59:51 2014 +0100

    OpenACC: pcopy, pcopyin, pcopyout, pcreate clauses.
    
        gcc/c/
        * c-parser.c (c_parser_omp_clause_name): Accept pcopy, pcopyin,
        pcopyout, pcreate clauses.
        (c_parser_oacc_data_clause): Update comment.
        gcc/
        * tree-core.h (omp_clause_code) <map>: Mention pcopy, pcopyin,
        pcopyout, pcreate OpenACC clauses.
        gcc/testsuite/
        * c-c++-common/goacc/pcopy.c: New file.
        * c-c++-common/goacc/pcopyin.c: Likewise.
        * c-c++-common/goacc/pcopyout.c: Likewise.
        * c-c++-common/goacc/pcreate.c: Likewise.

diff --git gcc/c/c-parser.c gcc/c/c-parser.c
index 6e89471..f401cef 100644
--- gcc/c/c-parser.c
+++ gcc/c/c-parser.c
@@ -9671,13 +9671,17 @@ c_parser_omp_clause_name (c_parser *parser)
            result = PRAGMA_OMP_CLAUSE_PARALLEL;
          else if (!strcmp ("present", p))
            result = PRAGMA_OMP_CLAUSE_PRESENT;
-         else if (!strcmp ("present_or_copy", p))
+         else if (!strcmp ("present_or_copy", p)
+                  || !strcmp ("pcopy", p))
            result = PRAGMA_OMP_CLAUSE_PRESENT_OR_COPY;
-         else if (!strcmp ("present_or_copyin", p))
+         else if (!strcmp ("present_or_copyin", p)
+                  || !strcmp ("pcopyin", p))
            result = PRAGMA_OMP_CLAUSE_PRESENT_OR_COPYIN;
-         else if (!strcmp ("present_or_copyout", p))
+         else if (!strcmp ("present_or_copyout", p)
+                  || !strcmp ("pcopyout", p))
            result = PRAGMA_OMP_CLAUSE_PRESENT_OR_COPYOUT;
-         else if (!strcmp ("present_or_create", p))
+         else if (!strcmp ("present_or_create", p)
+                  || !strcmp ("pcreate", p))
            result = PRAGMA_OMP_CLAUSE_PRESENT_OR_CREATE;
          else if (!strcmp ("private", p))
            result = PRAGMA_OMP_CLAUSE_PRIVATE;
@@ -9870,9 +9874,13 @@ c_parser_omp_var_list_parens (c_parser *parser, enum 
omp_clause_code kind,
    delete ( variable-list )
    present ( variable-list )
    present_or_copy ( variable-list )
+     pcopy ( variable-list )
    present_or_copyin ( variable-list )
+     pcopyin ( variable-list )
    present_or_copyout ( variable-list )
-   present_or_create ( variable-list ) */
+     pcopyout ( variable-list )
+   present_or_create ( variable-list )
+     pcreate ( variable-list ) */
 
 static tree
 c_parser_oacc_data_clause (c_parser *parser, pragma_omp_clause c_kind,
diff --git gcc/testsuite/c-c++-common/goacc/pcopy.c 
gcc/testsuite/c-c++-common/goacc/pcopy.c
new file mode 100644
index 0000000..fd16525
--- /dev/null
+++ gcc/testsuite/c-c++-common/goacc/pcopy.c
@@ -0,0 +1,11 @@
+/* { dg-additional-options "-fdump-tree-original" } */
+
+void
+f (char *cp)
+{
+#pragma acc parallel pcopy(cp[3:5])
+  ;
+}
+
+/* { dg-final { scan-tree-dump-times "#pragma acc parallel 
map\\(tofrom:\\*\\(cp \\+ 3\\) \\\[len: 5]\\) map\\(alloc:cp \\\[pointer 
assign, bias: 3]\\)" 1 "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git gcc/testsuite/c-c++-common/goacc/pcopyin.c 
gcc/testsuite/c-c++-common/goacc/pcopyin.c
new file mode 100644
index 0000000..c009d24
--- /dev/null
+++ gcc/testsuite/c-c++-common/goacc/pcopyin.c
@@ -0,0 +1,11 @@
+/* { dg-additional-options "-fdump-tree-original" } */
+
+void
+f (char *cp)
+{
+#pragma acc parallel pcopyin(cp[4:6])
+  ;
+}
+
+/* { dg-final { scan-tree-dump-times "#pragma acc parallel map\\(to:\\*\\(cp 
\\+ 4\\) \\\[len: 6]\\) map\\(alloc:cp \\\[pointer assign, bias: 4]\\)" 1 
"original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git gcc/testsuite/c-c++-common/goacc/pcopyout.c 
gcc/testsuite/c-c++-common/goacc/pcopyout.c
new file mode 100644
index 0000000..6099eff
--- /dev/null
+++ gcc/testsuite/c-c++-common/goacc/pcopyout.c
@@ -0,0 +1,11 @@
+/* { dg-additional-options "-fdump-tree-original" } */
+
+void
+f (char *cp)
+{
+#pragma acc parallel pcopyout(cp[5:7])
+  ;
+}
+
+/* { dg-final { scan-tree-dump-times "#pragma acc parallel map\\(from:\\*\\(cp 
\\+ 5\\) \\\[len: 7]\\) map\\(alloc:cp \\\[pointer assign, bias: 5]\\)" 1 
"original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git gcc/testsuite/c-c++-common/goacc/pcreate.c 
gcc/testsuite/c-c++-common/goacc/pcreate.c
new file mode 100644
index 0000000..2f6e836
--- /dev/null
+++ gcc/testsuite/c-c++-common/goacc/pcreate.c
@@ -0,0 +1,11 @@
+/* { dg-additional-options "-fdump-tree-original" } */
+
+void
+f (char *cp)
+{
+#pragma acc parallel pcreate(cp[6:8])
+  ;
+}
+
+/* { dg-final { scan-tree-dump-times "#pragma acc parallel 
map\\(alloc:\\*\\(cp \\+ 6\\) \\\[len: 8]\\) map\\(alloc:cp \\\[pointer assign, 
bias: 6]\\)" 1 "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git gcc/tree-core.h gcc/tree-core.h
index a5a95cd..2d9bf0c 100644
--- gcc/tree-core.h
+++ gcc/tree-core.h
@@ -259,8 +259,9 @@ enum omp_clause_code {
   OMP_CLAUSE_TO,
 
   /* OpenACC clauses: {copy, copyin, copyout, create, delete, deviceptr,
-     present, present_or_copy, present_or_copyin, present_or_copyout,
-     present_or_create} (variable-list).
+     present, present_or_copy (pcopy), present_or_copyin (pcopyin),
+     present_or_copyout (pcopyout), present_or_create (pcreate)}
+     (variable-list).
 
      OpenMP clause: map ({alloc:,to:,from:,tofrom:,}variable-list).  */
   OMP_CLAUSE_MAP,


Grüße,
 Thomas

Attachment: pgpv_CjKPs27b.pgp
Description: PGP signature

Reply via email to