From 9df6c0e4edf8810c7ed31f78eeb5ee4838d3c114 Mon Sep 17 00:00:00 2001 From: Julian Brown Date: Tue, 4 Dec 2018 12:35:06 +0000 Subject: [PATCH] OpenACC wait list diagnostic change 2018-12-04 James Norris Cesar Philippidis Julian Brown 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 Reviewed-by: Joseph Myers From-SVN: r266774 --- gcc/c/ChangeLog | 7 +++++++ gcc/c/c-parser.c | 8 -------- gcc/cp/ChangeLog | 5 +++++ gcc/cp/parser.c | 6 ++++-- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/c-c++-common/goacc/asyncwait-1.c | 8 ++++++-- 6 files changed, 27 insertions(+), 12 deletions(-) diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 1f1b81fe7ba..6f0f67cc190 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,10 @@ +2018-12-04 James Norris + Cesar Philippidis + Julian Brown + + * c-parser.c (c_parser_oacc_wait_list): Remove dead diagnostic + code. + 2018-11-30 Richard Biener * gimple-parser.c (c_parser_gimple_postfix_expression): Parse diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index afc40710e83..0d7fcc0f722 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/ChangeLog b/gcc/cp/ChangeLog index 48f802b4221..866fd33e6bd 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2018-12-04 Julian Brown + + * parser.c (cp_parser_oacc_wait_list): Fix error message and avoid + duplicate diagnostic. + 2018-12-04 Jakub Jelinek PR c++/88103 diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index ab6d2378622..ac19cb4b9bb 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/ChangeLog b/gcc/testsuite/ChangeLog index 99a44439754..2c7e3a9b670 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-12-04 Julian Brown + + * c-c++-common/goacc/asyncwait-1: Update expected errors and add a + test for "wait (". + 2018-12-04 Jakub Jelinek PR c++/88103 diff --git a/gcc/testsuite/c-c++-common/goacc/asyncwait-1.c b/gcc/testsuite/c-c++-common/goacc/asyncwait-1.c index e1840af5d70..2f5d4762b49 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" } */ -- 2.30.2