This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch,openacc] C, C++ OpenACC wait diagnostic change
- From: Thomas Schwinge <thomas at codesourcery dot com>
- To: Julian Brown <julian at codesourcery dot com>
- Cc: Joseph Myers <joseph at codesourcery dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 4 Dec 2018 12:45:48 +0100
- Subject: Re: [patch,openacc] C, C++ OpenACC wait diagnostic change
- References: <38bae4a6-8ef1-b1df-95e2-54f03e07f173@codesourcery.com> <alpine.DEB.2.21.1809261948240.17757@digraph.polyomino.org.uk> <47265b45-bc7d-6bb5-eba3-fe0697202803@codesourcery.com> <20180928141742.7352e5e7@squid.athome> <yxfpzhtqr3ih.fsf@hertz.schwinge.homeip.net> <20181203211050.6c1510c8@squid.athome>
Hi Julian!
On Mon, 3 Dec 2018 21:10:50 +0000, Julian Brown <julian@codesourcery.com> wrote:
> On Fri, 30 Nov 2018 16:25:42 +0100
> Thomas Schwinge <thomas@codesourcery.com> wrote:
> > [...]
>
> I've made those changes in the attached, thank you. OK?
Yes, thanks!
Grüße
Thomas
> 2018-XX-YY James Norris <jnorris@codesourcery.com>
> Cesar Philippidis <cesar@codesourcery.com>
> Julian Brown <julian@codesourcery.com>
>
> gcc/c/
> * c-parser.c (c_parser_oacc_wait_list): Remove dead diagnostic
> code.
>
> gcc/cp/
> * parser.c (cp_parser_oacc_wait_list): Fix error message and avoid
> duplicate diagnostic.
>
> gcc/testsuite/
> * c-c++-common/goacc/asyncwait-1: Update expected errors and add a
> test for "wait (".
>
> Reviewed-by: Thomas Schwinge <thomas@codesourcery.com>
> Reviewed-by: Joseph Myers <joseph@codesourcery.com>
> commit e3f9a5935e9ec3062017602a580139a0bccf1f4c
> Author: Julian Brown <julian@codesourcery.com>
> Date: Fri Sep 28 05:52:55 2018 -0700
>
> OpenACC wait list diagnostic change
>
> 2018-XX-YY James Norris <jnorris@codesourcery.com>
> Cesar Philippidis <cesar@codesourcery.com>
> Julian Brown <julian@codesourcery.com>
>
> gcc/c/
> * c-parser.c (c_parser_oacc_wait_list): Remove dead diagnostic
> code.
>
> gcc/cp/
> * parser.c (cp_parser_oacc_wait_list): Fix error message and avoid
> duplicate diagnostic.
>
> gcc/testsuite/
> * c-c++-common/goacc/asyncwait-1: Update expected errors and add a
> test for "wait (".
>
> diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c
> index afc4071..0d7fcc0 100644
> --- a/gcc/c/c-parser.c
> +++ b/gcc/c/c-parser.c
> @@ -11801,14 +11801,6 @@ c_parser_oacc_wait_list (c_parser *parser, location_t clause_loc, tree list)
> return list;
>
> args = c_parser_expr_list (parser, false, true, NULL, NULL, NULL, NULL);
> -
> - if (args->length () == 0)
> - {
> - c_parser_error (parser, "expected integer expression before ')'");
> - release_tree_vector (args);
> - return list;
> - }
> -
> args_tree = build_tree_list_vec (args);
>
> for (t = args_tree; t; t = TREE_CHAIN (t))
> diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
> index ab6d237..ac19cb4 100644
> --- a/gcc/cp/parser.c
> +++ b/gcc/cp/parser.c
> @@ -32605,9 +32605,11 @@ cp_parser_oacc_wait_list (cp_parser *parser, location_t clause_loc, tree list)
>
> if (args == NULL || args->length () == 0)
> {
> - cp_parser_error (parser, "expected integer expression before ')'");
> if (args != NULL)
> - release_tree_vector (args);
> + {
> + cp_parser_error (parser, "expected integer expression list");
> + release_tree_vector (args);
> + }
> return list;
> }
>
> diff --git a/gcc/testsuite/c-c++-common/goacc/asyncwait-1.c b/gcc/testsuite/c-c++-common/goacc/asyncwait-1.c
> index e1840af..2f5d476 100644
> --- a/gcc/testsuite/c-c++-common/goacc/asyncwait-1.c
> +++ b/gcc/testsuite/c-c++-common/goacc/asyncwait-1.c
> @@ -116,7 +116,6 @@ f (int N, float *a, float *b)
> }
>
> #pragma acc parallel copyin (a[0:N]) copy (b[0:N]) wait (1 /* { dg-error "expected '\\\)' before end of line" } */
> - /* { dg-error "expected integer expression before '\\\)'" "" { target c++ } .-1 } */
> {
> for (ii = 0; ii < N; ii++)
> b[ii] = a[ii];
> @@ -152,6 +151,12 @@ f (int N, float *a, float *b)
> b[ii] = a[ii];
> }
>
> +#pragma acc parallel copyin (a[0:N]) copy (b[0:N]) wait ( /* { dg-error "expected (primary-|)expression before" } */
> + {
> + for (ii = 0; ii < N; ii++)
> + b[ii] = a[ii];
> + }
> +
> #pragma acc parallel copyin (a[0:N]) copy (b[0:N]) wait
> {
> for (ii = 0; ii < N; ii++)
> @@ -171,7 +176,6 @@ f (int N, float *a, float *b)
> #pragma acc wait (1,2,,) /* { dg-error "expected (primary-|)expression before" } */
>
> #pragma acc wait (1 /* { dg-error "expected '\\\)' before end of line" } */
> - /* { dg-error "expected integer expression before '\\\)'" "" { target c++ } .-1 } */
>
> #pragma acc wait (1,*) /* { dg-error "expected (primary-|)expression before" } */
>