On 01/27/2017 07:07 AM, Jakub Jelinek wrote: > On Fri, Jan 27, 2017 at 07:02:45AM -0800, Cesar Philippidis wrote:
>> diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c >> index 61940d7..2782a8d 100644 >> --- a/gcc/fortran/openmp.c >> +++ b/gcc/fortran/openmp.c >> @@ -5192,7 +5192,8 @@ gfc_resolve_oacc_blocks (gfc_code *code, gfc_namespace >> *ns) >> { >> fortran_omp_context ctx; >> oacc_function dims = OACC_FUNCTION_NONE; >> - >> + gfc_omp_namelist *n; >> + >> resolve_oacc_loop_blocks (code); >> >> ctx.code = code; >> @@ -5217,6 +5218,10 @@ gfc_resolve_oacc_blocks (gfc_code *code, >> gfc_namespace *ns) >> ctx.dims = dims; >> omp_current_ctx = &ctx; >> >> + if (code->ext.omp_clauses) >> + for (n = code->ext.omp_clauses->lists[OMP_LIST_PRIVATE]; n; n = n->next) >> + ctx.private_iterators->add (n->sym); > > Do you really want to add to private_iterators even variables that aren't > iterators, just arbitrary private variable? Well, the other thing we can do is scan the list of private clauses and look for the induction variable. But that would result in an O(n) lookup vs O(1) with the hash. My impression is that this approach should be innocuous, because it doesn't appear that private_iterators are used for anything else at the moment. Cesar