Hi Julian!

On 2020-06-04T06:40:55-0700, Julian Brown <jul...@codesourcery.com> wrote:
> This patch provides the same fix for Fortran derived type component
> mappings with derived types as the patch posted previously:
>
>   https://gcc.gnu.org/legacy-ml/gcc-patches/2020-01/msg00512.html
>
> IIUC this part was previously approved by Tobias.  OK?

I don't have in-depth knowledge of these Fortran front end OMP parts.
Tobias had reviewed and approved your patch in January, and I'll assume
his approval still holds.  Or are you asking for further review of the
patch?

I suppose we want this backported to releases/gcc-10 branch, too?

> --- /dev/null
> +++ b/gcc/testsuite/gfortran.dg/goacc/mapping-tests-3.f90
> @@ -0,0 +1,15 @@
> +! { dg-options "-fopenacc -fdump-tree-omplower" }

As '-fopenacc' is the default for 'gfortran.dg/goacc/', you can avoid to
repeat it by using '{ dg-additional-options "-fdump-tree-omplower" }'.

Just curious: specific reason to scan '-fdump-tree-omplower' -- wouldn't
the problem be visible in '-fdump-tree-original' or
'-fdump-tree-gimplify' already?

> +
> +subroutine foo
> +  type one
> +    integer i, j
> +  end type
> +  type two
> +    type(one) A, B
> +  end type
> +
> +  type(two) x
> +
> +  !$acc enter data copyin(x%A)
> +! { dg-final { scan-tree-dump-times "omp target oacc_enter_exit_data 
> map\\(struct:x \\\[len: 1\\\]\\) map\\(to:x.a \\\[len: \[0-9\]+\\\]\\)" 1 
> "omplower" } }
> +end

> --- /dev/null
> +++ b/gcc/testsuite/gfortran.dg/goacc/mapping-tests-4.f90
> @@ -0,0 +1,17 @@
> +subroutine foo
> +  type one
> +    integer i, j
> +  end type
> +  type two
> +    type(one) A, B
> +  end type
> +
> +  type(two) x
> +
> +! This is accepted at present, although it represents a 
> probably-unintentional
> +! overlapping subcopy.
> +  !$acc enter data copyin(x%A, x%A%i)

Should that missing diagnostic get a PR filed, and that one be referenced
here?

> +! But this raises an error.
> +  !$acc enter data copyin(x%A, x%A%i, x%A%i)
> +! { dg-error ".x.a.i. appears more than once in map clauses" "" { target 
> "*-*-*" } 15 }
> +end

Not a problem, but unusual to see '"*-*-*"' quoted.  Preferable to use
relative '.-1' instead of absolute '15'.


Grüße
 Thomas
-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander 
Walter

Reply via email to