From 7fd549d24fda05c859fb17697c51c16886902dad Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Fri, 19 May 2017 15:32:48 +0200 Subject: OpenACC 2.5 default (present) clause gcc/c/ * c-parser.c (c_parser_omp_clause_default): Handle "OMP_CLAUSE_DEFAULT_PRESENT". gcc/cp/ * parser.c (cp_parser_omp_clause_default): Handle "OMP_CLAUSE_DEFAULT_PRESENT". gcc/fortran/ * gfortran.h (enum gfc_omp_default_sharing): Add "OMP_DEFAULT_PRESENT". * dump-parse-tree.c (show_omp_clauses): Handle it. * openmp.c (gfc_match_omp_clauses): Likewise. * trans-openmp.c (gfc_trans_omp_clauses): Likewise. gcc/ * tree-core.h (enum omp_clause_default_kind): Add "OMP_CLAUSE_DEFAULT_PRESENT". * tree-pretty-print.c (dump_omp_clause): Handle it. * gimplify.c (enum gimplify_omp_var_data): Add "GOVD_MAP_FORCE_PRESENT". (gimplify_adjust_omp_clauses_1): Map it to "GOMP_MAP_FORCE_PRESENT". (oacc_default_clause): Handle "OMP_CLAUSE_DEFAULT_PRESENT". gcc/testsuite/ * c-c++-common/goacc/default-1.c: Update. * c-c++-common/goacc/default-2.c: Likewise. * c-c++-common/goacc/default-4.c: Likewise. * gfortran.dg/goacc/default-1.f95: Likewise. * gfortran.dg/goacc/default-4.f: Likewise. * c-c++-common/goacc/default-5.c: New file. * gfortran.dg/goacc/default-5.f: Likewise. libgomp/ * testsuite/libgomp.oacc-c++/template-reduction.C: Update. * testsuite/libgomp.oacc-c-c++-common/nested-2.c: Update. * testsuite/libgomp.oacc-fortran/data-4-2.f90: Likewise. * testsuite/libgomp.oacc-fortran/default-1.f90: Likewise. * testsuite/libgomp.oacc-fortran/non-scalar-data.f90: Likewise. From-SVN: r248280 --- gcc/c/ChangeLog | 5 +++++ gcc/c/c-parser.c | 14 ++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) (limited to 'gcc/c') diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 79643cc..a70eaf9 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,8 @@ +2017-05-19 Thomas Schwinge + + * c-parser.c (c_parser_omp_clause_default): Handle + "OMP_CLAUSE_DEFAULT_PRESENT". + 2017-05-18 Bernd Edlinger * config-lang.in (gtfiles): Add c-family/c-format.c. diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index 96c0749..2e01316 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -11057,10 +11057,10 @@ c_parser_omp_clause_copyprivate (c_parser *parser, tree list) } /* OpenMP 2.5: - default ( shared | none ) + default ( none | shared ) - OpenACC 2.0: - default (none) */ + OpenACC: + default ( none | present ) */ static tree c_parser_omp_clause_default (c_parser *parser, tree list, bool is_oacc) @@ -11083,6 +11083,12 @@ c_parser_omp_clause_default (c_parser *parser, tree list, bool is_oacc) kind = OMP_CLAUSE_DEFAULT_NONE; break; + case 'p': + if (strcmp ("present", p) != 0 || !is_oacc) + goto invalid_kind; + kind = OMP_CLAUSE_DEFAULT_PRESENT; + break; + case 's': if (strcmp ("shared", p) != 0 || is_oacc) goto invalid_kind; @@ -11099,7 +11105,7 @@ c_parser_omp_clause_default (c_parser *parser, tree list, bool is_oacc) { invalid_kind: if (is_oacc) - c_parser_error (parser, "expected %"); + c_parser_error (parser, "expected % or %"); else c_parser_error (parser, "expected % or %"); } -- cgit v1.1