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: Cesar Philippidis <cesar at codesourcery dot com>
- To: Julian Brown <julian at codesourcery dot com>, <gcc-patches at gcc dot gnu dot org>, Jakub Jelinek <jakub at redhat dot com>
- Date: Tue, 28 Aug 2018 12:23:22 -0700
- Subject: Re: [PATCH, OpenACC] (2/2) Fix implicit mapping for array slices on lexically-enclosing data constructs (PR70828)
- References: <20180828151934.1d60ea68@squid.athome>
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.
Cesar