From patchwork Tue Jun 28 12:13:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 641515 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rf4Tr22vcz9sCk for ; Tue, 28 Jun 2016 22:13:51 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=t2x95OHr; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=pg3sXuwlJhIVNQvh Ya4oAbpuoNHmA6s1HVJayxRynbcPjCXKRMWX+yGk25PldTIK6A1aER42hOM+9SEx U6JojRtqh2tauwYAHSDP7gIjx2zIOEFSmWpyiyc1jQUj9eTd5sZDpXD5uvLfnxQs QO1vtHShnn54kt+eBHeETRpQVoE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=default; bh=lEev1aeRnH0XfcDFL5xt0l Ekv+4=; b=t2x95OHrZmdorr9Yb5Bv8EpDxQCJ84xBbwie+vgIpCQrbfRUo+xyVb UNQIAD6URuWI298ac3YbZcFRrH1BXun/h5lg81Vc2lBBHhZplXMn4qI0PRML7I5v PI9F2iiOjcTyn2UGo6F++BzXQWVtGqt/SNH7yCrTnBp4XRdIOubtQ= Received: (qmail 34429 invoked by alias); 28 Jun 2016 12:13:44 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 34419 invoked by uid 89); 28 Jun 2016 12:13:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS, URIBL_RED autolearn=ham version=3.3.2 spammy=sk:thomas@, openmp, OpenMP, *so X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 28 Jun 2016 12:13:32 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-02.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1bHrtR-0007W8-3X from Thomas_Schwinge@mentor.com ; Tue, 28 Jun 2016 05:13:29 -0700 Received: from hertz.schwinge.homeip.net (137.202.0.76) by SVR-IES-FEM-02.mgc.mentorg.com (137.202.0.106) with Microsoft SMTP Server id 14.3.224.2; Tue, 28 Jun 2016 13:13:27 +0100 From: Thomas Schwinge To: Jakub Jelinek , Subject: Clarify PRAGMA_OACC_* and PRAGMA_OMP_* User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/24.4.1 (x86_64-pc-linux-gnu) Date: Tue, 28 Jun 2016 14:13:24 +0200 Message-ID: <8737nxpl3v.fsf@hertz.schwinge.homeip.net> MIME-Version: 1.0 Hi! Looking at how OpenMP declare simd is handled in the C++ front end, I ran into it being parsed for PRAGMA_OMP_DECLARE_REDUCTION, which got me confused. OK to commit the following to un-confuse this, in that PRAGMA_OACC_* and PRAGMA_OMP_* don't describe what *eventually* is to be parsed (which (nowadays?) is wrong for PRAGMA_OMP_DECLARE_REDUCTION, anyway), but instead they describe what *so far* has been parsed. commit fa557f6ad39992052decb413501c713db8ec59f0 Author: Thomas Schwinge Date: Tue Jun 28 14:12:23 2016 +0200 Clarify PRAGMA_OACC_* and PRAGMA_OMP_* gcc/c-family/ * c-pragma.h (enum pragma_kind): Rename PRAGMA_OACC_ENTER_DATA to PRAGMA_OACC_ENTER, PRAGMA_OACC_EXIT_DATA to PRAGMA_OACC_EXIT, PRAGMA_OMP_CANCELLATION_POINT to PRAGMA_OMP_CANCELLATION, PRAGMA_OMP_DECLARE_REDUCTION to PRAGMA_OMP_DECLARE, PRAGMA_OMP_END_DECLARE_TARGET to PRAGMA_OMP_END. Adjust all users. --- gcc/c-family/c-pragma.c | 10 +++++----- gcc/c-family/c-pragma.h | 10 +++++----- gcc/c/c-parser.c | 12 ++++++------ gcc/cp/parser.c | 16 ++++++++-------- 4 files changed, 24 insertions(+), 24 deletions(-) Grüße Thomas diff --git gcc/c-family/c-pragma.c gcc/c-family/c-pragma.c index c73aa82..093b1a1 100644 --- gcc/c-family/c-pragma.c +++ gcc/c-family/c-pragma.c @@ -1256,8 +1256,8 @@ static const struct omp_pragma_def oacc_pragmas[] = { { "cache", PRAGMA_OACC_CACHE }, { "data", PRAGMA_OACC_DATA }, { "declare", PRAGMA_OACC_DECLARE }, - { "enter", PRAGMA_OACC_ENTER_DATA }, - { "exit", PRAGMA_OACC_EXIT_DATA }, + { "enter", PRAGMA_OACC_ENTER }, + { "exit", PRAGMA_OACC_EXIT }, { "host_data", PRAGMA_OACC_HOST_DATA }, { "kernels", PRAGMA_OACC_KERNELS }, { "loop", PRAGMA_OACC_LOOP }, @@ -1270,9 +1270,9 @@ static const struct omp_pragma_def omp_pragmas[] = { { "atomic", PRAGMA_OMP_ATOMIC }, { "barrier", PRAGMA_OMP_BARRIER }, { "cancel", PRAGMA_OMP_CANCEL }, - { "cancellation", PRAGMA_OMP_CANCELLATION_POINT }, + { "cancellation", PRAGMA_OMP_CANCELLATION }, { "critical", PRAGMA_OMP_CRITICAL }, - { "end", PRAGMA_OMP_END_DECLARE_TARGET }, + { "end", PRAGMA_OMP_END }, { "flush", PRAGMA_OMP_FLUSH }, { "master", PRAGMA_OMP_MASTER }, { "ordered", PRAGMA_OMP_ORDERED }, @@ -1286,7 +1286,7 @@ static const struct omp_pragma_def omp_pragmas[] = { { "threadprivate", PRAGMA_OMP_THREADPRIVATE } }; static const struct omp_pragma_def omp_pragmas_simd[] = { - { "declare", PRAGMA_OMP_DECLARE_REDUCTION }, + { "declare", PRAGMA_OMP_DECLARE }, { "distribute", PRAGMA_OMP_DISTRIBUTE }, { "for", PRAGMA_OMP_FOR }, { "parallel", PRAGMA_OMP_PARALLEL }, diff --git gcc/c-family/c-pragma.h gcc/c-family/c-pragma.h index 65f10db..9f70a3f 100644 --- gcc/c-family/c-pragma.h +++ gcc/c-family/c-pragma.h @@ -31,8 +31,8 @@ enum pragma_kind { PRAGMA_OACC_CACHE, PRAGMA_OACC_DATA, PRAGMA_OACC_DECLARE, - PRAGMA_OACC_ENTER_DATA, - PRAGMA_OACC_EXIT_DATA, + PRAGMA_OACC_ENTER, + PRAGMA_OACC_EXIT, PRAGMA_OACC_HOST_DATA, PRAGMA_OACC_KERNELS, PRAGMA_OACC_LOOP, @@ -44,11 +44,11 @@ enum pragma_kind { PRAGMA_OMP_ATOMIC, PRAGMA_OMP_BARRIER, PRAGMA_OMP_CANCEL, - PRAGMA_OMP_CANCELLATION_POINT, + PRAGMA_OMP_CANCELLATION, PRAGMA_OMP_CRITICAL, - PRAGMA_OMP_DECLARE_REDUCTION, + PRAGMA_OMP_DECLARE, PRAGMA_OMP_DISTRIBUTE, - PRAGMA_OMP_END_DECLARE_TARGET, + PRAGMA_OMP_END, PRAGMA_OMP_FLUSH, PRAGMA_OMP_FOR, PRAGMA_OMP_MASTER, diff --git gcc/c/c-parser.c gcc/c/c-parser.c index 7f491f1..ccdd043 100644 --- gcc/c/c-parser.c +++ gcc/c/c-parser.c @@ -10108,11 +10108,11 @@ c_parser_pragma (c_parser *parser, enum pragma_context context, bool *if_p) c_parser_oacc_declare (parser); return false; - case PRAGMA_OACC_ENTER_DATA: + case PRAGMA_OACC_ENTER: c_parser_oacc_enter_exit_data (parser, true); return false; - case PRAGMA_OACC_EXIT_DATA: + case PRAGMA_OACC_EXIT: c_parser_oacc_enter_exit_data (parser, false); return false; @@ -10186,7 +10186,7 @@ c_parser_pragma (c_parser *parser, enum pragma_context context, bool *if_p) c_parser_omp_cancel (parser); return false; - case PRAGMA_OMP_CANCELLATION_POINT: + case PRAGMA_OMP_CANCELLATION: if (context != pragma_compound) { if (context == pragma_stmt) @@ -10204,7 +10204,7 @@ c_parser_pragma (c_parser *parser, enum pragma_context context, bool *if_p) case PRAGMA_OMP_TARGET: return c_parser_omp_target (parser, context, if_p); - case PRAGMA_OMP_END_DECLARE_TARGET: + case PRAGMA_OMP_END: c_parser_omp_end_declare_target (parser); return false; @@ -10215,7 +10215,7 @@ c_parser_pragma (c_parser *parser, enum pragma_context context, bool *if_p) c_parser_skip_until_found (parser, CPP_PRAGMA_EOL, NULL); return false; - case PRAGMA_OMP_DECLARE_REDUCTION: + case PRAGMA_OMP_DECLARE: c_parser_omp_declare (parser, context); return false; @@ -16381,7 +16381,7 @@ c_parser_omp_declare_simd (c_parser *parser, enum pragma_context context) while (c_parser_next_token_is (parser, CPP_PRAGMA)) { if (c_parser_peek_token (parser)->pragma_kind - != PRAGMA_OMP_DECLARE_REDUCTION + != PRAGMA_OMP_DECLARE || c_parser_peek_2nd_token (parser)->type != CPP_NAME || strcmp (IDENTIFIER_POINTER (c_parser_peek_2nd_token (parser)->value), diff --git gcc/cp/parser.c gcc/cp/parser.c index d1f06fd..6a90706 100644 --- gcc/cp/parser.c +++ gcc/cp/parser.c @@ -36731,10 +36731,10 @@ cp_parser_omp_construct (cp_parser *parser, cp_token *pragma_tok, bool *if_p) case PRAGMA_OACC_DATA: stmt = cp_parser_oacc_data (parser, pragma_tok, if_p); break; - case PRAGMA_OACC_ENTER_DATA: + case PRAGMA_OACC_ENTER: stmt = cp_parser_oacc_enter_exit_data (parser, pragma_tok, true); break; - case PRAGMA_OACC_EXIT_DATA: + case PRAGMA_OACC_EXIT: stmt = cp_parser_oacc_enter_exit_data (parser, pragma_tok, false); break; case PRAGMA_OACC_HOST_DATA: @@ -37203,7 +37203,7 @@ cp_parser_pragma (cp_parser *parser, enum pragma_context context, bool *if_p) parser->lexer->in_pragma = true; id = cp_parser_pragma_kind (pragma_tok); - if (id != PRAGMA_OMP_DECLARE_REDUCTION && id != PRAGMA_OACC_ROUTINE) + if (id != PRAGMA_OMP_DECLARE && id != PRAGMA_OACC_ROUTINE) cp_ensure_no_omp_declare_simd (parser); switch (id) { @@ -37290,7 +37290,7 @@ cp_parser_pragma (cp_parser *parser, enum pragma_context context, bool *if_p) } break; - case PRAGMA_OMP_CANCELLATION_POINT: + case PRAGMA_OMP_CANCELLATION: switch (context) { case pragma_compound: @@ -37310,7 +37310,7 @@ cp_parser_pragma (cp_parser *parser, enum pragma_context context, bool *if_p) cp_parser_omp_threadprivate (parser, pragma_tok); return false; - case PRAGMA_OMP_DECLARE_REDUCTION: + case PRAGMA_OMP_DECLARE: cp_parser_omp_declare (parser, pragma_tok, context); return false; @@ -37325,8 +37325,8 @@ cp_parser_pragma (cp_parser *parser, enum pragma_context context, bool *if_p) case PRAGMA_OACC_ATOMIC: case PRAGMA_OACC_CACHE: case PRAGMA_OACC_DATA: - case PRAGMA_OACC_ENTER_DATA: - case PRAGMA_OACC_EXIT_DATA: + case PRAGMA_OACC_ENTER: + case PRAGMA_OACC_EXIT: case PRAGMA_OACC_HOST_DATA: case PRAGMA_OACC_KERNELS: case PRAGMA_OACC_PARALLEL: @@ -37365,7 +37365,7 @@ cp_parser_pragma (cp_parser *parser, enum pragma_context context, bool *if_p) pop_omp_privatization_clauses (stmt); return ret; - case PRAGMA_OMP_END_DECLARE_TARGET: + case PRAGMA_OMP_END: cp_parser_omp_end_declare_target (parser, pragma_tok); return false;