public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Thomas Schwinge <thomas@codesourcery.com>
To: Jakub Jelinek <jakub@redhat.com>, <gcc-patches@gcc.gnu.org>
Cc: Cesar Philippidis <cesar@codesourcery.com>
Subject: Re: OMP_CLAUSES with clauses in operand 0
Date: Wed, 29 Apr 2015 16:07:00 -0000	[thread overview]
Message-ID: <87lhhbq6n8.fsf@schwinge.name> (raw)
In-Reply-To: <20150429152854.GJ1751@tucnak.redhat.com>

[-- Attachment #1: Type: text/plain, Size: 6052 bytes --]

Hi!

On Wed, 29 Apr 2015 17:28:54 +0200, Jakub Jelinek <jakub@redhat.com> wrote:
> On Wed, Apr 29, 2015 at 05:25:39PM +0200, Thomas Schwinge wrote:
> > Done.  (I also reverted the gcc/cp/pt.c:tsubst_expr change which
> > motivated this patch; will include that with the patch adding support for
> > C++ templates usage with OpenACC directives.)  OK for trunk?
> 
> Ok, thanks.

Committed in r222580:

commit 95cfd3918aef02196f24de30a1e7cbd34e45e827
Author: tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Wed Apr 29 15:44:41 2015 +0000

    Add OMP_STANDALONE_CLAUSES.
    
    	gcc/
    	* tree.h (OMP_STANDALONE_CLAUSES): New macro.
    	* gimplify.c (gimplify_omp_workshare): Use it.
    	gcc/c/
    	* c-parser.c (c_parser_oacc_enter_exit_data): Use
    	OMP_STANDALONE_CLAUSES.
    	gcc/cp/
    	* parser.c (cp_parser_oacc_enter_exit_data): Use
    	OMP_STANDALONE_CLAUSES.
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222580 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog    |    5 +++++
 gcc/c/ChangeLog  |    5 +++++
 gcc/c/c-parser.c |    5 +----
 gcc/cp/ChangeLog |    5 +++++
 gcc/cp/parser.c  |    5 +----
 gcc/gimplify.c   |   13 +++++--------
 gcc/tree.h       |    6 ++++++
 7 files changed, 28 insertions(+), 16 deletions(-)

diff --git gcc/ChangeLog gcc/ChangeLog
index 4fb5490..11cb62a 100644
--- gcc/ChangeLog
+++ gcc/ChangeLog
@@ -1,3 +1,8 @@
+2015-04-29  Thomas Schwinge  <thomas@codesourcery.com>
+
+	* tree.h (OMP_STANDALONE_CLAUSES): New macro.
+	* gimplify.c (gimplify_omp_workshare): Use it.
+
 2015-04-29  Richard Sandiford  <richard.sandiford@arm.com>
 
 	* Makefile.in (build/genrecog.o): Depend on inchash.h.
diff --git gcc/c/ChangeLog gcc/c/ChangeLog
index 9c769ca..6d8dbb1 100644
--- gcc/c/ChangeLog
+++ gcc/c/ChangeLog
@@ -1,3 +1,8 @@
+2015-04-29  Thomas Schwinge  <thomas@codesourcery.com>
+
+	* c-parser.c (c_parser_oacc_enter_exit_data): Use
+	OMP_STANDALONE_CLAUSES.
+
 2015-04-28  Marek Polacek  <polacek@redhat.com>
 
 	* c-parser.c (c_parser_binary_expression): Remove duplicate line.
diff --git gcc/c/c-parser.c gcc/c/c-parser.c
index cc8a4e3..bf0e4c57 100644
--- gcc/c/c-parser.c
+++ gcc/c/c-parser.c
@@ -12154,10 +12154,7 @@ c_parser_oacc_enter_exit_data (c_parser *parser, bool enter)
 
   stmt = enter ? make_node (OACC_ENTER_DATA) : make_node (OACC_EXIT_DATA);
   TREE_TYPE (stmt) = void_type_node;
-  if (enter)
-    OACC_ENTER_DATA_CLAUSES (stmt) = clauses;
-  else
-    OACC_EXIT_DATA_CLAUSES (stmt) = clauses;
+  OMP_STANDALONE_CLAUSES (stmt) = clauses;
   SET_EXPR_LOCATION (stmt, loc);
   add_stmt (stmt);
 }
diff --git gcc/cp/ChangeLog gcc/cp/ChangeLog
index 3ee050c..9442faa 100644
--- gcc/cp/ChangeLog
+++ gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2015-04-29  Thomas Schwinge  <thomas@codesourcery.com>
+
+	* parser.c (cp_parser_oacc_enter_exit_data): Use
+	OMP_STANDALONE_CLAUSES.
+
 2015-04-29  Paolo Carlini  <paolo.carlini@oracle.com>
 
 	PR c++/64667
diff --git gcc/cp/parser.c gcc/cp/parser.c
index 4ea2ca2..cfb512b 100644
--- gcc/cp/parser.c
+++ gcc/cp/parser.c
@@ -31606,10 +31606,7 @@ cp_parser_oacc_enter_exit_data (cp_parser *parser, cp_token *pragma_tok,
 
   stmt = enter ? make_node (OACC_ENTER_DATA) : make_node (OACC_EXIT_DATA);
   TREE_TYPE (stmt) = void_type_node;
-  if (enter)
-    OACC_ENTER_DATA_CLAUSES (stmt) = clauses;
-  else
-    OACC_EXIT_DATA_CLAUSES (stmt) = clauses;
+  OMP_STANDALONE_CLAUSES (stmt) = clauses;
   SET_EXPR_LOCATION (stmt, pragma_tok->location);
   add_stmt (stmt);
   return stmt;
diff --git gcc/gimplify.c gcc/gimplify.c
index 1d5341e..9ce3dd9 100644
--- gcc/gimplify.c
+++ gcc/gimplify.c
@@ -7411,34 +7411,31 @@ gimplify_omp_workshare (tree *expr_p, gimple_seq *pre_p)
 static void
 gimplify_omp_target_update (tree *expr_p, gimple_seq *pre_p)
 {
-  tree expr = *expr_p, clauses;
+  tree expr = *expr_p;
   int kind;
   gomp_target *stmt;
 
   switch (TREE_CODE (expr))
     {
     case OACC_ENTER_DATA:
-      clauses = OACC_ENTER_DATA_CLAUSES (expr);
       kind = GF_OMP_TARGET_KIND_OACC_ENTER_EXIT_DATA;
       break;
     case OACC_EXIT_DATA:
-      clauses = OACC_EXIT_DATA_CLAUSES (expr);
       kind = GF_OMP_TARGET_KIND_OACC_ENTER_EXIT_DATA;
       break;
     case OACC_UPDATE:
-      clauses = OACC_UPDATE_CLAUSES (expr);
       kind = GF_OMP_TARGET_KIND_OACC_UPDATE;
       break;
     case OMP_TARGET_UPDATE:
-      clauses = OMP_TARGET_UPDATE_CLAUSES (expr);
       kind = GF_OMP_TARGET_KIND_UPDATE;
       break;
     default:
       gcc_unreachable ();
     }
-  gimplify_scan_omp_clauses (&clauses, pre_p, ORT_WORKSHARE);
-  gimplify_adjust_omp_clauses (pre_p, &clauses);
-  stmt = gimple_build_omp_target (NULL, kind, clauses);
+  gimplify_scan_omp_clauses (&OMP_STANDALONE_CLAUSES (expr), pre_p,
+			     ORT_WORKSHARE);
+  gimplify_adjust_omp_clauses (pre_p, &OMP_STANDALONE_CLAUSES (expr));
+  stmt = gimple_build_omp_target (NULL, kind, OMP_STANDALONE_CLAUSES (expr));
 
   gimplify_seq_add_stmt (pre_p, stmt);
   *expr_p = NULL_TREE;
diff --git gcc/tree.h gcc/tree.h
index 2ec9708..e17bd9b 100644
--- gcc/tree.h
+++ gcc/tree.h
@@ -1197,11 +1197,17 @@ extern void protected_set_expr_location (tree, location_t);
 
 /* OpenMP and OpenACC directive and clause accessors.  */
 
+/* Generic accessors for OMP nodes that keep the body as operand 0, and clauses
+   as operand 1.  */
 #define OMP_BODY(NODE) \
   TREE_OPERAND (TREE_RANGE_CHECK (NODE, OACC_PARALLEL, OMP_CRITICAL), 0)
 #define OMP_CLAUSES(NODE) \
   TREE_OPERAND (TREE_RANGE_CHECK (NODE, OACC_PARALLEL, OMP_SINGLE), 1)
 
+/* Generic accessors for OMP nodes that keep clauses as operand 0.  */
+#define OMP_STANDALONE_CLAUSES(NODE) \
+  TREE_OPERAND (TREE_RANGE_CHECK (NODE, OACC_CACHE, OMP_TARGET_UPDATE), 0)
+
 #define OACC_PARALLEL_BODY(NODE) \
   TREE_OPERAND (OACC_PARALLEL_CHECK (NODE), 0)
 #define OACC_PARALLEL_CLAUSES(NODE) \


Grüße,
 Thomas

[-- Attachment #2: Type: application/pgp-signature, Size: 472 bytes --]

      reply	other threads:[~2015-04-29 15:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <553E695A.2070007@mentor.com>
     [not found] ` <87zj5ttqpz.fsf@schwinge.name>
     [not found]   ` <553E787A.1020109@mentor.com>
2015-04-28 19:30     ` Fix OpenMP's target update directive in templated code Thomas Schwinge
2015-04-29  9:00       ` Jakub Jelinek
2015-04-29  9:30         ` Thomas Schwinge
2015-04-29  9:32         ` OMP_CLAUSES with clauses in operand 0 (was: Fix OpenMP's target update directive in templated code) Thomas Schwinge
2015-04-29 10:06           ` Jakub Jelinek
2015-04-29 11:14             ` OMP_CLAUSES with clauses in operand 0 Thomas Schwinge
2015-04-29 11:55               ` Jakub Jelinek
2015-04-29 14:37                 ` Thomas Schwinge
2015-04-29 14:52                   ` Jakub Jelinek
2015-04-29 15:46                     ` Thomas Schwinge
2015-04-29 16:04                       ` Jakub Jelinek
2015-04-29 16:07                         ` Thomas Schwinge [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lhhbq6n8.fsf@schwinge.name \
    --to=thomas@codesourcery.com \
    --cc=cesar@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).