On Wed, May 28, 2014 at 10:38:55PM +0200, Thomas Schwinge wrote: > --- gcc/c/c-parser.c > +++ gcc/c/c-parser.c > @@ -13530,7 +13530,7 @@ c_parser_omp_target_update (location_t loc, c_parser > *parser, > && find_omp_clause (clauses, OMP_CLAUSE_FROM) == NULL_TREE) > { > error_at (loc, > - "%<#pragma omp target update must contain at least one " > + "%<#pragma omp target update%> must contain at least one " > "%<from%> or %<to%> clauses"); > return false; > }
This is fine, ditto the cp/parser.c change. > --- gcc/c/c-typeck.c > +++ gcc/c/c-typeck.c > @@ -12152,6 +12152,8 @@ c_finish_omp_clauses (tree clauses) > remove = true; > } > } > + /* Currently, we're not doing any further checking for array > + sections. */ > break; > } > if (t == error_mark_node) I don't know what more checking would be desirable, in fact, reading the latest standard I actually see no restriction that the same list item can't appear in multiple map (or multiple from or multiple to) clauses on the same construct, there is only a restriction that the same list item should not appear in both to and from clauses on the same construct. Will need to go through my omp-lang related mails to see if this has been discussed post 4.0. But, as soon as array sections are involved, it is hard (especially if variable bounds are involved) to actually analyze this restriction. > +#pragma omp target update from(a, a, b) /* { dg-error "'a' appears more than > once in motion clauses" } */ > +#pragma omp target update to(a, a) to(b) /* { dg-error "'a' appears more > than once in motion clauses" } */ > +#pragma omp target update from(a) from(a, b) /* { dg-error "'a' appears more > than once in motion clauses" } */ See above, I believe this is not invalid. > +#pragma omp target update from(a) to(a) from(b) /* { dg-error "'a' appears > more than once in motion clauses" } */ > +#pragma omp target update to(a) to(a) from(b) /* { dg-error "'a' appears > more than once in motion clauses" } */ The above one too. > +#pragma omp target update from(a, b, b) /* { dg-error "'b' appears more than > once in motion clauses" } */ > +#pragma omp target update to(a) to(b, b) /* { dg-error "'b' appears more > than once in motion clauses" } */ > +#pragma omp target update from(a, b) from(b) /* { dg-error "'b' appears more > than once in motion clauses" } */ > +#pragma omp target update from(a) to(b) from(b) /* { dg-error "'b' appears > more than once in motion clauses" } */ > +#pragma omp target update from(a) to(b) to(b) /* { dg-error "'b' appears > more than once in motion clauses" } */ > + > +#pragma omp target update to(a) from(a[1:1]) /* { dg-error "'a' appears more > than once in motion clauses" "not implemented" { xfail *-*-* } } */ Here I guess it really depends if a and a[1:1] is the same list item, I'd say they are not. I think it should be fine and useful to use at least the cases where there is the same underlying variable, but non-overlapping sections like: #pragma omp target update to(a[10:4]) from(a[0:5]) Jakub