From patchwork Wed Oct 25 09:10:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 157949 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp2465445vqx; Wed, 25 Oct 2023 02:11:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFpe3ZjJcqwM07IRzgWwmkenDcl3hZj8gYuQzLT5paIBtubYDUD3kIfOPTD5ahhqFOhYW4u X-Received: by 2002:a05:622a:452:b0:418:a0f:90e9 with SMTP id o18-20020a05622a045200b004180a0f90e9mr14774021qtx.1.1698225077330; Wed, 25 Oct 2023 02:11:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698225077; cv=pass; d=google.com; s=arc-20160816; b=wX+kPZZg/1gt0+SHcV+0UXMMrNPH60+fOJvM6WvOtI5Yr3XLVSy+Em/QLH6zg9RCC6 jnbwfcQMYjrL8SZO5XocipVVPZ7p8uPmmkIxwm0GTaA9xo10el5vpxg3MLo00hDBa3+6 LuZ0kwDGKbO+dM0WnzkAvo4pIHjK7OpmWpMBhHN/uPMMEqza/mAo8kYGrT1FavLXrii9 EtyS1Uc2pbAaT3aCyge8zObGfMcadqJKcqWnjGgWXD6kwZzndM9PO7OtQumD4u/HA5yb OWDcMEWLeoYTJVK0bsaF1AEdlfNaDorx3PGCofqz+66SIevFVe/Zna/m945dIl3Uea/h i0Tw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version:message-id:date :user-agent:references:in-reply-to:subject:cc:to:from:ironport-sdr :arc-filter:dmarc-filter:delivered-to; bh=eln7iMxZemElZtNguDKkEqFnR6hzkCuYJtZRVYbr20c=; fh=fUaghwsITalRfY5ECywWs9xQrYlBehvJbVsj5wI2vdM=; b=Jy6x7e0WNAYr4T43n3k6h+bb9fw1yLDFaVefAJoNoAheMiiOdDT0i4/m2CNv/Vb5/p 09UmKhNdzJpX1/YFhDtzUFZyt93j+P26Mg/8mNSjqL9D+vZsO8VgOZ6IT4hL1i9cKP2j uM9mW+e1iF+iGJVqNoW5qchqBGpYhwJ7A0Y69cZsh0ZpATt4tib+wGE683vufJWhhGqB JSYrHSWNdMAytgHxJpTQJl1YI0ygK07CA5i8GjbzbZEHWzKXO3w1/moU6912v3jUKVVR Lb6MYztVD3u10oxh9EdzhuzmoErseKIa9Fk6rypQMDDSkz0M4juB6hFjzZheEmA5h7j6 b/mw== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id m6-20020a05622a054600b0040fe2df28c6si8430257qtx.723.2023.10.25.02.11.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 02:11:17 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1B281385C6D7 for ; Wed, 25 Oct 2023 09:11:17 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id 34D6F3858404; Wed, 25 Oct 2023 09:10:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 34D6F3858404 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 34D6F3858404 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=68.232.137.180 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698225050; cv=none; b=TOoOgLWu43l7OBC6EahhmUI1LP4nbOJV6FW91vn5+mACAIQdVdAkrqib21Ua9H4snpfTnAL07/DjdSSM+rBcEv7qbC/A9y5N7pLgFG83mOMoo8Y/L9Yxup23FnoNyPPXobfctBVwaHLspwj3dnpQVg3ZmLp3g2yHed/B7rOQgAY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698225050; c=relaxed/simple; bh=2+B6OKW9gE+q9gRJm2+WmCVqyltJ6z0dXZz4H1tGErw=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=VgQt1ICol2V0xqQK4gtCoTH7uODqDjzeDcJIVdBHNhevPxn+0+8KHGmHnSpE2WFWxRR15avlXZbdXNK1jw9aXOWJUK+CLhDZqcmveRcRcaWgKGNxiuyIM1Ix1C4WtMpDnqggSczg870rwk91Id+6EywLekZDVuU2614WAUJOvrM= ARC-Authentication-Results: i=1; server2.sourceware.org X-CSE-ConnectionGUID: 8PsoeLfwTGaV0ZkqT201Yg== X-CSE-MsgGUID: mYIdjHxMRieneFJqQQYfiQ== X-IronPort-AV: E=Sophos;i="6.03,250,1694764800"; d="scan'208,223";a="20710796" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 25 Oct 2023 01:10:44 -0800 IronPort-SDR: t/UVrQ82SJrwmjiHo3jlQe5MeBkjkVhKDEUhMuAhwfWWKSNV11MEtcLbVNvkoAXykDRXGSZuY0 INdf1b3bsNGCRZ9LMfcbGs2157cWp0DSyY2hIzP7lw/N8RbHtCpQTgQn26XMBFD3WNBbtDMWmf UQAHJ9YLlwEJY5prhHn8HnUJOoqHWQWNQ2rrG3IuMSDB5ybCKy+JdROXg3eFQDsCb/EnTqy1cw BAwJ6tbgX82Es1Sk3B/Iy9a3CGhaEmX0q0nYjYpwFN4nFMA8LClcQ/8UDTlBiXCpVI8k7g4fs3 Vdg= From: Thomas Schwinge To: Chung-Lin Tang , , CC: Catherine Moore , Tobias Burnus Subject: Disentangle handling of OpenACC 'host', 'self' pragma tokens (was: [PATCH, OpenACC 2.7] Implement self clause for compute constructs) In-Reply-To: <87pm13w04d.fsf@euler.schwinge.homeip.net> References: <87pm13w04d.fsf@euler.schwinge.homeip.net> User-Agent: Notmuch/0.29.3+94~g74c3f1b (https://notmuchmail.org) Emacs/28.2 (x86_64-pc-linux-gnu) Date: Wed, 25 Oct 2023 11:10:37 +0200 Message-ID: <87jzrbvzhu.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_LOTSOFHASH, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780718058845692197 X-GMAIL-MSGID: 1780718058845692197 Hi! On 2023-10-25T10:57:06+0200, I wrote: > With minor textual conflicts resolved, I've pushed this to master branch > in commit 3a3596389c2e539cb8fd5dc5784a4e2afe193a2a > "OpenACC 2.7: Implement self clause for compute constructs", see > attached. > > > I'll then apply/submit a number of follow-on commits. I found this: > --- a/gcc/c/c-parser.cc > +++ b/gcc/c/c-parser.cc > static tree > c_parser_oacc_all_clauses (c_parser *parser, omp_clause_mask mask, > - const char *where, bool finish_p = true) > + const char *where, bool finish_p = true, > + bool compute_p = false) > { > tree clauses = NULL; > bool first = true; > @@ -18064,7 +18100,18 @@ c_parser_oacc_all_clauses (c_parser *parser, omp_clause_mask mask, > c_parser_consume_token (parser); > > here = c_parser_peek_token (parser)->location; > - c_kind = c_parser_omp_clause_name (parser); > + > + /* For OpenACC compute directives */ > + if (compute_p > + && c_parser_next_token_is (parser, CPP_NAME) > + && !strcmp (IDENTIFIER_POINTER (c_parser_peek_token (parser)->value), > + "self")) > + { > + c_kind = PRAGMA_OACC_CLAUSE_SELF; > + c_parser_consume_token (parser); > + } > + else > + c_kind = c_parser_omp_clause_name (parser); ..., and similarly in the C++ and (to a lesser extent) Fortran front ends a bit twisted, and pushed to master branch commit c92509d9fd98e02d17ab1610f696c88f606dcdf4 "Disentangle handling of OpenACC 'host', 'self' pragma tokens", see attached. Grüße Thomas ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955 From c92509d9fd98e02d17ab1610f696c88f606dcdf4 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Fri, 20 Oct 2023 14:47:58 +0200 Subject: [PATCH] Disentangle handling of OpenACC 'host', 'self' pragma tokens 'gcc/c-family/c-pragma.h:pragma_omp_clause' already defines 'PRAGMA_OACC_CLAUSE_SELF', but it has no longer been used for the 'update' directive's 'self' clause as of 2018 commit 829c6349e96c5bfa8603aaef8858b38e237a2f33 (Subversion r261813) "Update OpenACC data clause semantics to the 2.5 behavior". That one instead mapped the 'self' pragma token to the 'host' one (same semantics). That means that we're later not able to tell whether originally we had seen 'self' or 'host', which was OK as long as only the 'update' directive had a 'self' clause. However, as of recent commit 3a3596389c2e539cb8fd5dc5784a4e2afe193a2a "OpenACC 2.7: Implement self clause for compute constructs", also OpenACC compute constructs may have a 'self' clause -- with different semantics. That means, we need to know which OpenACC directive we're parsing clauses for, which can be done in a simpler way than in that commit, similar to how the OpenMP 'to' clause is handled. While at that, clarify that (already in OpenACC 2.0a) "The 'host' clause is a synonym for the 'self' clause." -- not the other way round. gcc/c/ * c-parser.cc (c_parser_omp_clause_name): Return 'PRAGMA_OACC_CLAUSE_SELF' for "self". (c_parser_oacc_data_clause, OACC_UPDATE_CLAUSE_MASK): Adjust. (c_parser_oacc_all_clauses): Remove 'bool compute_p' formal parameter, and instead locally determine whether we're called for an OpenACC compute construct or OpenACC 'update' directive. (c_parser_oacc_compute): Adjust. gcc/cp/ * parser.cc (cp_parser_omp_clause_name): Return 'PRAGMA_OACC_CLAUSE_SELF' for "self". (cp_parser_oacc_data_clause, OACC_UPDATE_CLAUSE_MASK): Adjust. (cp_parser_oacc_all_clauses): Remove 'bool compute_p' formal parameter, and instead locally determine whether we're called for an OpenACC compute construct or OpenACC 'update' directive. (cp_parser_oacc_compute): Adjust. gcc/fortran/ * openmp.cc (omp_mask2): Split 'OMP_CLAUSE_HOST_SELF' into 'OMP_CLAUSE_SELF', 'OMP_CLAUSE_HOST'. (gfc_match_omp_clauses, OACC_UPDATE_CLAUSES): Adjust. --- gcc/c/c-parser.cc | 38 +++++++++++++++++--------------------- gcc/cp/parser.cc | 39 +++++++++++++++++---------------------- gcc/fortran/openmp.cc | 27 ++++++++++++++------------- 3 files changed, 48 insertions(+), 56 deletions(-) diff --git a/gcc/c/c-parser.cc b/gcc/c/c-parser.cc index a82f5afeff7..5213a57a1ec 100644 --- a/gcc/c/c-parser.cc +++ b/gcc/c/c-parser.cc @@ -14061,8 +14061,8 @@ c_parser_omp_clause_name (c_parser *parser) result = PRAGMA_OMP_CLAUSE_SCHEDULE; else if (!strcmp ("sections", p)) result = PRAGMA_OMP_CLAUSE_SECTIONS; - else if (!strcmp ("self", p)) /* "self" is a synonym for "host". */ - result = PRAGMA_OACC_CLAUSE_HOST; + else if (!strcmp ("self", p)) + result = PRAGMA_OACC_CLAUSE_SELF; else if (!strcmp ("seq", p)) result = PRAGMA_OACC_CLAUSE_SEQ; else if (!strcmp ("shared", p)) @@ -14583,9 +14583,6 @@ c_parser_oacc_data_clause (c_parser *parser, pragma_omp_clause c_kind, case PRAGMA_OACC_CLAUSE_DEVICE_RESIDENT: kind = GOMP_MAP_DEVICE_RESIDENT; break; - case PRAGMA_OACC_CLAUSE_HOST: - kind = GOMP_MAP_FORCE_FROM; - break; case PRAGMA_OACC_CLAUSE_LINK: kind = GOMP_MAP_LINK; break; @@ -14595,6 +14592,11 @@ c_parser_oacc_data_clause (c_parser *parser, pragma_omp_clause c_kind, case PRAGMA_OACC_CLAUSE_PRESENT: kind = GOMP_MAP_FORCE_PRESENT; break; + case PRAGMA_OACC_CLAUSE_SELF: + /* "The 'host' clause is a synonym for the 'self' clause." */ + case PRAGMA_OACC_CLAUSE_HOST: + kind = GOMP_MAP_FORCE_FROM; + break; default: gcc_unreachable (); } @@ -18083,8 +18085,7 @@ c_parser_omp_clause_detach (c_parser *parser, tree list) static tree c_parser_oacc_all_clauses (c_parser *parser, omp_clause_mask mask, - const char *where, bool finish_p = true, - bool compute_p = false) + const char *where, bool finish_p = true) { tree clauses = NULL; bool first = true; @@ -18100,18 +18101,7 @@ c_parser_oacc_all_clauses (c_parser *parser, omp_clause_mask mask, c_parser_consume_token (parser); here = c_parser_peek_token (parser)->location; - - /* For OpenACC compute directives */ - if (compute_p - && c_parser_next_token_is (parser, CPP_NAME) - && !strcmp (IDENTIFIER_POINTER (c_parser_peek_token (parser)->value), - "self")) - { - c_kind = PRAGMA_OACC_CLAUSE_SELF; - c_parser_consume_token (parser); - } - else - c_kind = c_parser_omp_clause_name (parser); + c_kind = c_parser_omp_clause_name (parser); switch (c_kind) { @@ -18244,7 +18234,12 @@ c_parser_oacc_all_clauses (c_parser *parser, omp_clause_mask mask, c_name = "reduction"; break; case PRAGMA_OACC_CLAUSE_SELF: - clauses = c_parser_oacc_compute_clause_self (parser, clauses); + if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_HOST)) == 0) + /* OpenACC compute construct */ + clauses = c_parser_oacc_compute_clause_self (parser, clauses); + else + /* OpenACC 'update' directive */ + clauses = c_parser_oacc_data_clause (parser, c_kind, clauses); c_name = "self"; break; case PRAGMA_OACC_CLAUSE_SEQ: @@ -19166,7 +19161,7 @@ c_parser_oacc_compute (location_t loc, c_parser *parser, } } - tree clauses = c_parser_oacc_all_clauses (parser, mask, p_name, true, true); + tree clauses = c_parser_oacc_all_clauses (parser, mask, p_name); tree block = c_begin_omp_parallel (); add_stmt (c_parser_omp_structured_block (parser, if_p)); @@ -19366,6 +19361,7 @@ c_finish_oacc_routine (struct oacc_routine_data *data, tree fndecl, | (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_HOST) \ | (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_IF) \ | (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_IF_PRESENT) \ + | (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_SELF) \ | (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_WAIT) ) static void diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc index c5a9928ad27..5a6c416d932 100644 --- a/gcc/cp/parser.cc +++ b/gcc/cp/parser.cc @@ -37566,8 +37566,8 @@ cp_parser_omp_clause_name (cp_parser *parser) result = PRAGMA_OMP_CLAUSE_SCHEDULE; else if (!strcmp ("sections", p)) result = PRAGMA_OMP_CLAUSE_SECTIONS; - else if (!strcmp ("self", p)) /* "self" is a synonym for "host". */ - result = PRAGMA_OACC_CLAUSE_HOST; + else if (!strcmp ("self", p)) + result = PRAGMA_OACC_CLAUSE_SELF; else if (!strcmp ("seq", p)) result = PRAGMA_OACC_CLAUSE_SEQ; else if (!strcmp ("shared", p)) @@ -38004,9 +38004,6 @@ cp_parser_oacc_data_clause (cp_parser *parser, pragma_omp_clause c_kind, case PRAGMA_OACC_CLAUSE_DEVICE_RESIDENT: kind = GOMP_MAP_DEVICE_RESIDENT; break; - case PRAGMA_OACC_CLAUSE_HOST: - kind = GOMP_MAP_FORCE_FROM; - break; case PRAGMA_OACC_CLAUSE_LINK: kind = GOMP_MAP_LINK; break; @@ -38016,6 +38013,11 @@ cp_parser_oacc_data_clause (cp_parser *parser, pragma_omp_clause c_kind, case PRAGMA_OACC_CLAUSE_PRESENT: kind = GOMP_MAP_FORCE_PRESENT; break; + case PRAGMA_OACC_CLAUSE_SELF: + /* "The 'host' clause is a synonym for the 'self' clause." */ + case PRAGMA_OACC_CLAUSE_HOST: + kind = GOMP_MAP_FORCE_FROM; + break; default: gcc_unreachable (); } @@ -41236,7 +41238,7 @@ cp_parser_oacc_compute_clause_self (cp_parser *parser, tree list) static tree cp_parser_oacc_all_clauses (cp_parser *parser, omp_clause_mask mask, const char *where, cp_token *pragma_tok, - bool finish_p = true, bool compute_p = false) + bool finish_p = true) { tree clauses = NULL; bool first = true; @@ -41256,19 +41258,7 @@ cp_parser_oacc_all_clauses (cp_parser *parser, omp_clause_mask mask, cp_lexer_consume_token (parser->lexer); here = cp_lexer_peek_token (parser->lexer)->location; - - /* For OpenACC compute directives */ - if (compute_p - && cp_lexer_next_token_is (parser->lexer, CPP_NAME) - && !strcmp (IDENTIFIER_POINTER - (cp_lexer_peek_token (parser->lexer)->u.value), - "self")) - { - c_kind = PRAGMA_OACC_CLAUSE_SELF; - cp_lexer_consume_token (parser->lexer); - } - else - c_kind = cp_parser_omp_clause_name (parser); + c_kind = cp_parser_omp_clause_name (parser); switch (c_kind) { @@ -41403,7 +41393,12 @@ cp_parser_oacc_all_clauses (cp_parser *parser, omp_clause_mask mask, c_name = "reduction"; break; case PRAGMA_OACC_CLAUSE_SELF: - clauses = cp_parser_oacc_compute_clause_self (parser, clauses); + if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_HOST)) == 0) + /* OpenACC compute construct */ + clauses = cp_parser_oacc_compute_clause_self (parser, clauses); + else + /* OpenACC 'update' directive */ + clauses = cp_parser_oacc_data_clause (parser, c_kind, clauses); c_name = "self"; break; case PRAGMA_OACC_CLAUSE_SEQ: @@ -47006,8 +47001,7 @@ cp_parser_oacc_compute (cp_parser *parser, cp_token *pragma_tok, } } - tree clauses = cp_parser_oacc_all_clauses (parser, mask, p_name, pragma_tok, - true, true); + tree clauses = cp_parser_oacc_all_clauses (parser, mask, p_name, pragma_tok); tree block = begin_omp_parallel (); unsigned int save = cp_parser_begin_omp_structured_block (parser); @@ -47026,6 +47020,7 @@ cp_parser_oacc_compute (cp_parser *parser, cp_token *pragma_tok, | (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_HOST) \ | (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_IF) \ | (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_IF_PRESENT) \ + | (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_SELF) \ | (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_WAIT)) static tree diff --git a/gcc/fortran/openmp.cc b/gcc/fortran/openmp.cc index 083c15e5599..2e2e23d567b 100644 --- a/gcc/fortran/openmp.cc +++ b/gcc/fortran/openmp.cc @@ -1080,7 +1080,8 @@ enum omp_mask2 OMP_CLAUSE_INDEPENDENT, OMP_CLAUSE_USE_DEVICE, OMP_CLAUSE_DEVICE_RESIDENT, - OMP_CLAUSE_HOST_SELF, + OMP_CLAUSE_SELF, + OMP_CLAUSE_HOST, OMP_CLAUSE_WAIT, OMP_CLAUSE_DELETE, OMP_CLAUSE_AUTO, @@ -1094,7 +1095,6 @@ enum omp_mask2 OMP_CLAUSE_DOACROSS, /* OpenMP 5.2 */ OMP_CLAUSE_ASSUMPTIONS, /* OpenMP 5.1. */ OMP_CLAUSE_USES_ALLOCATORS, /* OpenMP 5.0 */ - OMP_CLAUSE_SELF, /* OpenACC 2.7 */ /* This must come last. */ OMP_MASK2_LAST }; @@ -1877,8 +1877,7 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const omp_mask mask, that should work. */ bool allow_derived = (openacc && ((mask & OMP_CLAUSE_ATTACH) - || (mask & OMP_CLAUSE_DETACH) - || (mask & OMP_CLAUSE_HOST_SELF))); + || (mask & OMP_CLAUSE_DETACH))); gcc_checking_assert (OMP_MASK1_LAST <= 64 && OMP_MASK2_LAST <= 64); *cp = NULL; @@ -2550,7 +2549,7 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const omp_mask mask, && gfc_match ("device ( ") == MATCH_YES && gfc_match_omp_map_clause (&c->lists[OMP_LIST_MAP], OMP_MAP_FORCE_TO, true, - allow_derived)) + /* allow_derived = */ true)) continue; if ((mask & OMP_CLAUSE_DEVICEPTR) && gfc_match ("deviceptr ( ") == MATCH_YES @@ -2725,11 +2724,11 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const omp_mask mask, c->assume->holds = el; continue; } - if ((mask & OMP_CLAUSE_HOST_SELF) + if ((mask & OMP_CLAUSE_HOST) && gfc_match ("host ( ") == MATCH_YES && gfc_match_omp_map_clause (&c->lists[OMP_LIST_MAP], OMP_MAP_FORCE_FROM, true, - allow_derived)) + /* allow_derived = */ true)) continue; break; case 'i': @@ -3521,10 +3520,10 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const omp_mask mask, gfc_current_locus = old_loc; } if ((mask & OMP_CLAUSE_SELF) + && !(mask & OMP_CLAUSE_HOST) /* OpenACC compute construct */ && (m = gfc_match_dupl_check (!c->self_expr, "self")) != MATCH_NO) { - gcc_assert (!(mask & OMP_CLAUSE_HOST_SELF)); if (m == MATCH_ERROR) goto error; m = gfc_match (" ( %e )", &c->self_expr); @@ -3541,11 +3540,12 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const omp_mask mask, } continue; } - if ((mask & OMP_CLAUSE_HOST_SELF) + if ((mask & OMP_CLAUSE_SELF) + && (mask & OMP_CLAUSE_HOST) /* OpenACC 'update' directive */ && gfc_match ("self ( ") == MATCH_YES && gfc_match_omp_map_clause (&c->lists[OMP_LIST_MAP], OMP_MAP_FORCE_FROM, true, - allow_derived)) + /* allow_derived = */ true)) continue; if ((mask & OMP_CLAUSE_SEQ) && (m = gfc_match_dupl_check (!c->seq, "seq")) != MATCH_NO) @@ -3854,9 +3854,10 @@ error: | OMP_CLAUSE_CREATE | OMP_CLAUSE_DEVICEPTR | OMP_CLAUSE_DEVICE_RESIDENT \ | OMP_CLAUSE_PRESENT \ | OMP_CLAUSE_LINK) -#define OACC_UPDATE_CLAUSES \ - (omp_mask (OMP_CLAUSE_IF) | OMP_CLAUSE_ASYNC | OMP_CLAUSE_HOST_SELF \ - | OMP_CLAUSE_DEVICE | OMP_CLAUSE_WAIT | OMP_CLAUSE_IF_PRESENT) +#define OACC_UPDATE_CLAUSES \ + (omp_mask (OMP_CLAUSE_IF) | OMP_CLAUSE_ASYNC | OMP_CLAUSE_HOST \ + | OMP_CLAUSE_DEVICE | OMP_CLAUSE_WAIT | OMP_CLAUSE_IF_PRESENT \ + | OMP_CLAUSE_SELF) #define OACC_ENTER_DATA_CLAUSES \ (omp_mask (OMP_CLAUSE_IF) | OMP_CLAUSE_ASYNC | OMP_CLAUSE_WAIT \ | OMP_CLAUSE_COPYIN | OMP_CLAUSE_CREATE | OMP_CLAUSE_ATTACH) -- 2.34.1