This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Re: [OpenACC 4/11] C FE changes
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Cesar Philippidis <cesar_philippidis at mentor dot com>
- Cc: Nathan Sidwell <nathan at acm dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Bernd Schmidt <bschmidt at redhat dot com>, Jason Merrill <jason at redhat dot com>, "Joseph S. Myers" <joseph at codesourcery dot com>
- Date: Fri, 23 Oct 2015 23:25:12 +0200
- Subject: Re: Re: [OpenACC 4/11] C FE changes
- Authentication-results: sourceware.org; auth=none
- References: <20151022082249 dot GF478 at tucnak dot redhat dot com> <562A95C3 dot 2040100 at mentor dot com> <20151023203155 dot GJ478 at tucnak dot redhat dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Oct 23, 2015 at 10:31:55PM +0200, Jakub Jelinek wrote:
> Doesn't this mean that you happily parse
> gang (static: * abc)
> or
> gang (static:*num:1)
> etc.? I'd say the comma should be non-optional (i.e. either accept
> CPP_COMMA, or CPP_CLOSE_PARENT, but nothing else) in that case (at least,
> when in OpenMP grammar something is *-list it is meant to be comma
> separated).
Looking at the OpenACC standard, gang-arg-list is indeed a comma separated
list of gang-arg, so the above are not valid, so you really should just
error out and skip to close paren if at that spot isn't a CPP_COMMA or
CPP_CLOSE_PAREN. And for vector/worker arguments, which don't accept a
*-list, IMNSHO you shouldn't even try to accept CPP_COMMA, just require
CPP_CLOSE_PAREN.
>
> > + /* Consume a comma if present. */
> > + if (c_parser_next_token_is (parser, CPP_COMMA))
> > + c_parser_consume_token (parser);
>
> Similarly this means
> gang (num: 5 static: *)
> is accepted. If it is valid, then again it should have testsuite coverage.
Jakub