This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch] PR fortran/78260 - OpenACC + OpenMP target fixes - esp. with function-result variables
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Tobias Burnus <tobias at codesourcery dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, fortran <fortran at gcc dot gnu dot org>, Thomas Schwinge <thomas at codesourcery dot com>
- Date: Fri, 20 Sep 2019 18:00:59 +0200
- Subject: Re: [Patch] PR fortran/78260 - OpenACC + OpenMP target fixes - esp. with function-result variables
- References: <64ef5bde-759c-9a41-985f-6f1ccb02529d@codesourcery.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Sep 20, 2019 at 05:47:59PM +0200, Tobias Burnus wrote:
> This patch does two things:
>
> (A) For OpenACC, only, it fixes the is-variable check. That check missed to
> reject module names (as noted in the PR) but as my testing showed, it also
> wrongly rejected function-result variables. (i.e. where the return-value
> variable has the same name as the function). - For the invalid input of the
> PR, gfortran gave an ICE in the gimplifier.
>
> (B) Using such function-result variables did not work properly. OpenACC used
> in both cases (see pr78260-2.f90) the function name – and at least one
> variant failed with an ICE.
>
> OpenMP used the result variable for "target data map" but not for "target
> update". Additionally "task depend" had the same issue.
>
>
> Bootstrapped and regtested on x86_64-gnu-linux w/o accelerator.
>
> I intent to build/regtest it also applied to the OG9 (openacc-gnu-9) branch
> and run the test case with actual nvptx+AMDGCN offloading, but I have not
> done so, yet.
>
> OK for the trunk?
LGTM, thanks.
I'm not entirely sure about the detailed #pragma matches in the dumps, if
they turn out to be too hard to maintain, we can always remove those or
adjust so that they match with fewer details.
> 2019-09-20 Tobias Burnus <tobias@codesourcery.com>
>
> PR fortran/78260
> * openmp.c (gfc_resolve_oacc_declare): Reject all
> non variables but accept function result variables.
> * trans-openmp.c (gfc_trans_omp_clauses): Handle
> function-result variables for remaing cases.
>
> 2019-09-20 Tobias Burnus <tobias@codesourcery.com>
>
> PR fortran/78260
> * gfortran.dg/goacc/parameter.f95: Change
> dg-error as it is now detected earlier.
> * gfortran.dg/goacc/pr85701.f90: Modify to
> use a separate result variable.
> * gfortran.dg/goacc/pr78260.f90: New.
> * gfortran.dg/goacc/pr78260-2.f90: New.
> * gfortran.dg/gomp/pr78260.f90: New.
> * gfortran.dg/gomp/pr78260-2.f90: New.
> * gfortran.dg/gomp/pr78260-3.f90: New.
Jakub