From b1c9c068f75c6763c0c6d1f1973e1b95f148feb7 Mon Sep 17 00:00:00 2001 From: Cesar Philippidis Date: Fri, 15 Jul 2016 07:13:48 -0700 Subject: c-parser.c (c_parser_oacc_declare): Don't scan for GOMP_MAP_POINTER. gcc/c/ * c-parser.c (c_parser_oacc_declare): Don't scan for GOMP_MAP_POINTER. * c-typeck.c (handle_omp_array_sections): Mark data clauses with GOMP_MAP_FORCE_{PRESENT,TO,FROM,TOFROM} as potentially having zero-length subarrays. gcc/cp/ * parser.c (cp_parser_oacc_declare): Don't scan for GOMP_MAP_POINTER. * semantics.c (handle_omp_array_sections): Mark data clauses with GOMP_MAP_FORCE_{PRESENT,TO,FROM,TOFROM} as potentially having zero-length subarrays. gcc/ * omp-low.c (lower_omp_target): Mark data clauses with GOMP_MAP_FORCE_{PRESENT,TO,FROM,TOFROM} as potentially having zero-length subarrays. libgomp/ * testsuite/libgomp.oacc-c-c++-common/zero_length_subarrays.c: New test. From-SVN: r238376 --- gcc/ChangeLog | 6 ++++++ gcc/c/ChangeLog | 8 ++++++++ gcc/c/c-parser.c | 5 ----- gcc/c/c-typeck.c | 4 ++++ gcc/cp/ChangeLog | 8 ++++++++ gcc/cp/parser.c | 5 ----- gcc/cp/semantics.c | 4 ++++ gcc/omp-low.c | 4 ++++ 8 files changed, 34 insertions(+), 10 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9e39380..7f7fc13 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-07-15 Cesar Philippidis + + * omp-low.c (lower_omp_target): Mark data clauses with + GOMP_MAP_FORCE_{PRESENT,TO,FROM,TOFROM} as potentially having + zero-length subarrays. + 2016-07-15 Richard Biener PR tree-optimization/71881 diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 968d942..bc1e955 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,11 @@ +2016-07-15 Cesar Philippidis + + * c-parser.c (c_parser_oacc_declare): Don't scan for + GOMP_MAP_POINTER. + * c-typeck.c (handle_omp_array_sections): Mark data clauses with + GOMP_MAP_FORCE_{PRESENT,TO,FROM,TOFROM} as potentially having + zero-length subarrays. + 2016-07-15 Jakub Jelinek PR c/71858 diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index 8fb4e4d..ef585fb 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -13664,11 +13664,6 @@ c_parser_oacc_declare (c_parser *parser) case GOMP_MAP_DEVICE_RESIDENT: break; - case GOMP_MAP_POINTER: - /* Generated by c_finish_omp_clauses from array sections; - avoid spurious diagnostics. */ - break; - case GOMP_MAP_LINK: if (!global_bindings_p () && (TREE_STATIC (decl) diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c index bafd0d2..0b5ab91 100644 --- a/gcc/c/c-typeck.c +++ b/gcc/c/c-typeck.c @@ -12505,6 +12505,10 @@ handle_omp_array_sections (tree c, enum c_omp_region_type ort) case GOMP_MAP_ALWAYS_TOFROM: case GOMP_MAP_RELEASE: case GOMP_MAP_DELETE: + case GOMP_MAP_FORCE_TO: + case GOMP_MAP_FORCE_FROM: + case GOMP_MAP_FORCE_TOFROM: + case GOMP_MAP_FORCE_PRESENT: OMP_CLAUSE_MAP_MAYBE_ZERO_LENGTH_ARRAY_SECTION (c) = 1; break; default: diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index f7f7ba3..f85a333 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,11 @@ +2016-07-15 Cesar Philippidis + + * parser.c (cp_parser_oacc_declare): Don't scan for + GOMP_MAP_POINTER. + * semantics.c (handle_omp_array_sections): Mark data clauses with + GOMP_MAP_FORCE_{PRESENT,TO,FROM,TOFROM} as potentially having + zero-length subarrays. + 2016-07-11 Jason Merrill * decl.c (store_parm_decls): Remove check for void parm. diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index ef35aa9..3e865b0 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -35258,11 +35258,6 @@ cp_parser_oacc_declare (cp_parser *parser, cp_token *pragma_tok) case GOMP_MAP_DEVICE_RESIDENT: break; - case GOMP_MAP_POINTER: - /* Generated by c_finish_omp_clauses from array sections; - avoid spurious diagnostics. */ - break; - case GOMP_MAP_LINK: if (!global_bindings_p () && (TREE_STATIC (decl) diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index d1fb119..615d3ae 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -5002,6 +5002,10 @@ handle_omp_array_sections (tree c, enum c_omp_region_type ort) case GOMP_MAP_ALWAYS_TOFROM: case GOMP_MAP_RELEASE: case GOMP_MAP_DELETE: + case GOMP_MAP_FORCE_TO: + case GOMP_MAP_FORCE_FROM: + case GOMP_MAP_FORCE_TOFROM: + case GOMP_MAP_FORCE_PRESENT: OMP_CLAUSE_MAP_MAYBE_ZERO_LENGTH_ARRAY_SECTION (c) = 1; break; default: diff --git a/gcc/omp-low.c b/gcc/omp-low.c index ecba096..04509f3 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -16210,6 +16210,10 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_context *ctx) case GOMP_MAP_ALWAYS_FROM: case GOMP_MAP_ALWAYS_TOFROM: case GOMP_MAP_RELEASE: + case GOMP_MAP_FORCE_TO: + case GOMP_MAP_FORCE_FROM: + case GOMP_MAP_FORCE_TOFROM: + case GOMP_MAP_FORCE_PRESENT: tkind_zero = GOMP_MAP_ZERO_LEN_ARRAY_SECTION; break; case GOMP_MAP_DELETE: -- cgit v1.1