This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, OpenACC] (2/2) Fix implicit mapping for array slices on lexically-enclosing data constructs (PR70828)
- From: Julian Brown <julian at codesourcery dot com>
- To: Cesar Philippidis <cesar at codesourcery dot com>
- Cc: <gcc-patches at gcc dot gnu dot org>, Jakub Jelinek <jakub at redhat dot com>
- Date: Tue, 28 Aug 2018 17:32:07 -0400
- Subject: Re: [PATCH, OpenACC] (2/2) Fix implicit mapping for array slices on lexically-enclosing data constructs (PR70828)
- References: <20180828151934.1d60ea68@squid.athome> <371b7af7-df82-841b-fc72-e097cf000cef@codesourcery.com>
On Tue, 28 Aug 2018 12:23:22 -0700
Cesar Philippidis <cesar@codesourcery.com> wrote:
> On 08/28/2018 12:19 PM, Julian Brown wrote:
>
> > diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c
> > index f038f4c..86be407 100644
> > --- a/gcc/fortran/trans-openmp.c
> > +++ b/gcc/fortran/trans-openmp.c
> > @@ -1045,9 +1045,13 @@ gfc_omp_finish_clause (tree c, gimple_seq
> > *pre_p)
> > tree decl = OMP_CLAUSE_DECL (c);
> >
> > - /* Assumed-size arrays can't be mapped implicitly, they have to
> > be
> > - mapped explicitly using array sections. */
> > - if (TREE_CODE (decl) == PARM_DECL
> > + /* Assumed-size arrays can't be mapped implicitly, they have to
> > be mapped
> > + explicitly using array sections. An exception is if the
> > array is
> > + mapped explicitly in an enclosing data construct for OpenACC,
> > in which
> > + case we see GOMP_MAP_FORCE_PRESENT here and do not need to
> > raise an
> > + error. */
> > + if (OMP_CLAUSE_MAP_KIND (c) != GOMP_MAP_FORCE_PRESENT
> > + && TREE_CODE (decl) == PARM_DECL
> > && GFC_ARRAY_TYPE_P (TREE_TYPE (decl))
> > && GFC_TYPE_ARRAY_AKIND (TREE_TYPE (decl)) ==
> > GFC_ARRAY_UNKNOWN && GFC_TYPE_ARRAY_UBOUND (TREE_TYPE (decl),
>
> This is specific to OpenACC, and needs to be guarded as such.
Are you sure that condition can be true for OpenMP? I'd assumed not...
Julian