Re: [Patch] OpenMP/Fortran: Fix (re)mapping of allocatable/pointer arrays [PR96668]

2020-09-15 Thread Tobias Burnus
On 9/15/20 7:03 PM, Jakub Jelinek wrote: On Tue, Sep 15, 2020 at 12:48:59AM +0200, Tobias Burnus wrote: + bool has_nullptr; + size_t j; + for (j = 0; j < n->tgt->list_count; j++) +if (n->tgt->list[j].key == n) + { +has_nullptr

Re: [Patch] OpenMP/Fortran: Fix (re)mapping of allocatable/pointer arrays [PR96668]

2020-09-15 Thread Jakub Jelinek via Gcc-patches
On Tue, Sep 15, 2020 at 12:48:59AM +0200, Tobias Burnus wrote: > + bool has_nullptr; > + size_t j; > + for (j = 0; j < n->tgt->list_count; j++) > + if (n->tgt->list[j].key == n) > + { > + has_nullptr = n->tgt->list[j].has_null_

Re: [Patch] OpenMP/Fortran: Fix (re)mapping of allocatable/pointer arrays [PR96668]

2020-09-14 Thread Jakub Jelinek via Gcc-patches
On Tue, Sep 15, 2020 at 12:48:59AM +0200, Tobias Burnus wrote: > PR fortran/96668 > * gomp-constants.h (GOMP_MAP_ALWAYS_POINTER_P): Missing description (Define. ?) > > libgomp/ChangeLog: > > PR fortran/96668 > * libgomp.h (struct target_var_desc): > * target.c (gomp

Re: [Patch] OpenMP/Fortran: Fix (re)mapping of allocatable/pointer arrays [PR96668]

2020-09-14 Thread Tobias Burnus
On 9/14/20 1:03 PM, Jakub Jelinek wrote: + + if (flag_openmp && !(TYPE_QUALS (TREE_TYPE (ptr)) & TYPE_QUAL_RESTRICT)) +always_modifier = true; I think we don't want to depend on flag_openmp here, ... Guess for now an openacc flag with (ctx->region_type & ORT_ACC) != 0 passed to it seems

Re: [Patch] OpenMP/Fortran: Fix (re)mapping of allocatable/pointer arrays [PR96668]

2020-09-14 Thread Jakub Jelinek via Gcc-patches
On Mon, Sep 14, 2020 at 09:50:08AM +0200, Tobias Burnus wrote: > --- a/gcc/fortran/trans-openmp.c > +++ b/gcc/fortran/trans-openmp.c > @@ -1357,6 +1357,15 @@ gfc_omp_finish_clause (tree c, gimple_seq *pre_p) >tree type = TREE_TYPE (decl); >tree ptr = gfc_conv_descriptor_data_get (de

Re: [Patch] OpenMP/Fortran: Fix (re)mapping of allocatable/pointer arrays [PR96668]

2020-09-14 Thread Tobias Burnus
Second version, new is the second testcase, the change in omp-low.c, and around the two asserts in libgomp/target.c The new version now also handles 'omp declare target' variables. This usage occurs in five SPEC ACCEL testcases (all without 'always' clause), hence, real-world code seems to expect

[Patch] OpenMP/Fortran: Fix (re)mapping of allocatable/pointer arrays [PR96668]

2020-09-11 Thread Tobias Burnus
This is a first attempt to improve the OpenMP mapping for allocatables and pointers; there are some more issues – cf. PR and for scalars PR 97021. In real world code, a usage like the following is not uncommon: real, allocatable :: A(:,:) !$omp target enter data map(to: A) This maps an unalloca