Jakub, this patch implements firstprivate support for openacc. This is pretty straight forwards -- they're just regular auto variables, but with an initialization value from the host. The gimplify.c implementation is somewhat different to gomp4 branch, as I've added new bits to enum omp_region_type, rather than add 2 new fields to omp_region_ctx. The new enums use bits already defined in omp_region_type: + ORT_ACC = 0x40, /* An OpenACC region. */ + ORT_ACC_DATA = ORT_ACC | ORT_TARGET_DATA, /* Data construct. */ + ORT_ACC_PARALLEL = ORT_ACC | ORT_TARGET, /* Parallel construct */ + ORT_ACC_KERNELS = ORT_ACC | ORT_TARGET | 0x80, /* Kernels construct. */ On gomp4 we were already setting those bits, but then setting the new fields to indicate 'openacc'. Many places in gimplify.c where we check for '== ORT_TARGET_DATA' or ORT_TARGET get changed to '& ORT_TARGET_DATA' etc. On gomp4 for things like an openacc loop we were setting ORT_WORKSHARE, so nearly all checks for == ORT_WORKSHARE get an additional '|| X == ORT_ACC'. Although this patch doesn't make use of the difference between ORT_ACC_KERNELS and ORT_ACC_PARALLEL, the default handling patch will -- they have different behaviours. I think the gimpify.c changes are then obvious from that, but let me know. in omp-low the changes are to remove 'sorry' and build the initializer exprs in lower_omp_target. As you can see this fixes a few xfails. I'll post the default handling patch, which is much more localized. nathan