This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, OpenACC] (2/2) Fix implicit mapping for array slices on lexically-enclosing data constructs (PR70828)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]