On 01/06/2016 07:55 PM, Cesar Philippidis wrote: > @@ -1384,26 +1331,9 @@ build_outer_var_ref (tree var, omp_context *ctx, bool lastprivate = false) > x = build_simple_mem_ref (x); > } > } > - else if (is_oacc_parallel (ctx)) > - x = var; > else if (ctx->outer) > - { > - /* OpenACC may have multiple outer contexts (one per loop). */ > - if (gimple_code (ctx->stmt) == GIMPLE_OMP_FOR > - && gimple_omp_for_kind (ctx->stmt) == GF_OMP_FOR_KIND_OACC_LOOP) > - { > - do > - { > - ctx = ctx->outer; > - x = maybe_lookup_decl (var, ctx); > - } > - while(!x); > - } > - else > - x = lookup_decl (var, ctx->outer); > - } It turns out that this is still necessary for openacc. The attached patch reverts this particular change. This fixes a bug that I encountered in a program I which I didn't have time to reduce. Basically, that program was doing something like this #pragma acc loop vector(length:var) where var is some variable declared outside of a kernels region. I'll apply the patch to gomp4 now, and add a couple of more test cases next week. Cesar