From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 54796 invoked by alias); 3 Dec 2015 14:06:10 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 54785 invoked by uid 89); 3 Dec 2015 14:06:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 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 ESMTP; Thu, 03 Dec 2015 14:06:05 +0000 Received: from svr-orw-fem-04.mgc.mentorg.com ([147.34.97.41]) by relay1.mentorg.com with esmtp id 1a4UWH-0003Ka-8I from Cesar_Philippidis@mentor.com ; Thu, 03 Dec 2015 06:06:01 -0800 Received: from [127.0.0.1] (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.3.224.2; Thu, 3 Dec 2015 06:06:00 -0800 Subject: Re: [1/2] OpenACC routine support To: Thomas Schwinge References: <5637B1CF.5060408@acm.org> <5637B7C7.70901@acm.org> <20151103153533.GQ478@tucnak.redhat.com> <56413AF1.8070101@acm.org> <5641808F.10302@codesourcery.com> <20151110081603.GV5675@tucnak.redhat.com> <564CCB29.30909@codesourcery.com> <871tb6nsez.fsf@kepler.schwinge.homeip.net> <565DB379.5070306@codesourcery.com> <565F80AD.5090107@mentor.com> <87mvtskjyi.fsf@kepler.schwinge.homeip.net> CC: Nathan Sidwell , GCC Patches , Jakub Jelinek From: Cesar Philippidis Message-ID: <56604C48.2090400@mentor.com> Date: Thu, 03 Dec 2015 14:06:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <87mvtskjyi.fsf@kepler.schwinge.homeip.net> Content-Type: multipart/mixed; boundary="------------020802050509060105020704" X-SW-Source: 2015-12/txt/msg00439.txt.bz2 --------------020802050509060105020704 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-length: 1334 On 12/03/2015 12:36 AM, Thomas Schwinge wrote: >> Here's the updated patch. > > ENOPATCH. Here it is. >> The test cases were written in a way such that >> none of them needed to be updated with these changes. > > ... which potentially means they'd match for all kinds of "random" > diagnostics. ;-) They were supposed to be generic enough so that they work both in c and c++. But, yeah, that randomness is likely. >> I'm tempted to commit this as obvious, but I want to make sure you're ok >> with these new messages. > > I don't care very much, as long as it's understandable for a user. I > just tripped over this because of mismatches between C and C++ as well as > different C++ diagnostic variants. > >> The major change is to report these errors as >> "pragma acc routine not followed by a function declaration or >> definition". I think that's more descriptive then "not followed by a >> single function". That said, it looks like the c front end uses the >> latter error message. > > (In the C front end, the "a" is missing: "not followed by single > function"; that should be fixed up as well.) > >> Is this OK or do you prefer the "not followed by a single function" message? > > "not followed by a function declaration or definition" sounds good to me. Ok, I'll apply this patch in a couple of hours. Cesar --------------020802050509060105020704 Content-Type: text/x-patch; name="cxx-routines-cleanup.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="cxx-routines-cleanup.diff" Content-length: 3283 2015-12-02 Cesar Philippidis gcc/cp/ * parser.c (cp_ensure_no_oacc_routine): Update error message. (cp_parser_oacc_routine): Likewise. (cp_parser_late_parsing_oacc_routine): Likewise. Update comment describing this function. (cp_finalize_oacc_routine): Update error message. diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index b4ecac7..1c14354 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -1329,7 +1329,7 @@ cp_ensure_no_oacc_routine (cp_parser *parser) tree clauses = parser->oacc_routine->clauses; location_t loc = OMP_CLAUSE_LOCATION (TREE_PURPOSE (clauses)); - error_at (loc, "%<#pragma oacc routine%> not followed by function " + error_at (loc, "%<#pragma acc routine%> not followed by a function " "declaration or definition"); parser->oacc_routine = NULL; } @@ -35857,7 +35857,7 @@ cp_parser_oacc_routine (cp_parser *parser, cp_token *pragma_tok, cp_parser_require_pragma_eol (parser, pragma_tok); error_at (OMP_CLAUSE_LOCATION (parser->oacc_routine->clauses), - "%<#pragma oacc routine%> not followed by a single " + "%<#pragma acc routine%> not followed by a " "function declaration or definition"); parser->oacc_routine->error_seen = true; @@ -35962,7 +35962,7 @@ cp_parser_oacc_routine (cp_parser *parser, cp_token *pragma_tok, if (parser->oacc_routine && !parser->oacc_routine->error_seen && !parser->oacc_routine->fndecl_seen) - error_at (loc, "%<#pragma acc routine%> not followed by " + error_at (loc, "%<#pragma acc routine%> not followed by a " "function declaration or definition"); data.tokens.release (); @@ -35972,7 +35972,7 @@ cp_parser_oacc_routine (cp_parser *parser, cp_token *pragma_tok, } /* Finalize #pragma acc routine clauses after direct declarator has - been parsed, and put that into "oacc routine" attribute. */ + been parsed, and put that into "oacc function" attribute. */ static tree cp_parser_late_parsing_oacc_routine (cp_parser *parser, tree attrs) @@ -35987,7 +35987,7 @@ cp_parser_late_parsing_oacc_routine (cp_parser *parser, tree attrs) if ((!data->error_seen && data->fndecl_seen) || data->tokens.length () != 1) { - error_at (loc, "%<#pragma oacc routine%> not followed by a single " + error_at (loc, "%<#pragma acc routine%> not followed by a " "function declaration or definition"); data->error_seen = true; return attrs; @@ -36003,7 +36003,7 @@ cp_parser_late_parsing_oacc_routine (cp_parser *parser, tree attrs) cp_token *pragma_tok = cp_lexer_consume_token (parser->lexer); cl = cp_parser_oacc_all_clauses (parser, OACC_ROUTINE_CLAUSE_MASK, - "#pragma oacc routine", pragma_tok); + "#pragma acc routine", pragma_tok); cp_parser_pop_lexer (parser); tree c_head = build_omp_clause (loc, OMP_CLAUSE_SEQ); @@ -36044,7 +36044,8 @@ cp_finalize_oacc_routine (cp_parser *parser, tree fndecl, bool is_defn) if (!fndecl || TREE_CODE (fndecl) != FUNCTION_DECL) { error_at (loc, - "%<#pragma acc routine%> not followed by single function"); + "%<#pragma acc routine%> not followed by a function " + "declaration or definition"); parser->oacc_routine = NULL; } --------------020802050509060105020704--