On Wed, Jun 05, 2019 at 11:25:07AM +0200, Thomas Schwinge wrote: > libgomp/ > PR fortran/90743 > * oacc-parallel.c (GOACC_parallel_keyed): Handle NULL case. > * testsuite/libgomp.fortran/target-allocatable-1.f90: New file. > * testsuite/libgomp.oacc-fortran/allocatable-1.f90: New file. > --- > libgomp/oacc-parallel.c | 9 ++- > .../libgomp.fortran/target-allocatable-1.f90 | 8 +++ > .../libgomp.oacc-fortran/allocatable-1.f90 | 70 +++++++++++++++++++ > 3 files changed, 84 insertions(+), 3 deletions(-) > create mode 100644 libgomp/testsuite/libgomp.fortran/target-allocatable-1.f90 > create mode 100644 libgomp/testsuite/libgomp.oacc-fortran/allocatable-1.f90 > > diff --git a/libgomp/oacc-parallel.c b/libgomp/oacc-parallel.c > index e56330f6226b..0c2cfa05a438 100644 > --- a/libgomp/oacc-parallel.c > +++ b/libgomp/oacc-parallel.c > @@ -325,9 +325,12 @@ GOACC_parallel_keyed (int flags_m, void (*fn) (void *), > > devaddrs = gomp_alloca (sizeof (void *) * mapnum); > for (i = 0; i < mapnum; i++) > - devaddrs[i] = (void *) (tgt->list[i].key->tgt->tgt_start > - + tgt->list[i].key->tgt_offset > - + tgt->list[i].offset); > + if (tgt->list[i].key != NULL) > + devaddrs[i] = (void *) (tgt->list[i].key->tgt->tgt_start > + + tgt->list[i].key->tgt_offset > + + tgt->list[i].offset); > + else > + devaddrs[i] = NULL;
I don't know what does OpenACC require for allocatables, so can't comment on this (and it falls under OpenACC maintainance). > + > + !$omp target map(to: a) map(tofrom: b, c, d) map(from: e) > + !$acc parallel copyin(a) copy(b, c, d) copyout(e) Is mixing OpenMP and OpenACC construct this way defined at all? I see we reject OpenMP constructs inside of OpenACC contexts, and using OpenACC constructs inside host OpenMP constructs should be generally fine too, but mixing OpenMP offloading constructs with OpenACC constructs sounds wrong. Jakub