https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114002

--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> ---
This is probably be fixed by my r16-1660-g1e35a518258e8c

commit 1e35a518258e8cd970a2326bba5a4c8b10695439
Author: Tobias Burnus <[email protected]>
Date:   Tue Jun 24 23:28:57 2025 +0200

    Fortran/OpenACC: Add Fortran support for acc_attach/acc_detach

    While C/++ support the routines acc_attach{,_async} and
    acc_detach{,_finalize}{,_async} routines since a long time, the Fortran
    API routines where only added in OpenACC 3.3.

    Unfortunately, they cannot directly be implemented in the library as
    GCC will introduce a temporary array descriptor in some cases, which
    causes the attempted attachment to the this temporary variable instead
    of to the original one.

    Therefore, those API routines are handled in a special way in the compiler.

    gcc/fortran/ChangeLog:

            * trans-stmt.cc (gfc_trans_call_acc_attach_detach): New.
            (gfc_trans_call): Call it.

    libgomp/ChangeLog:

            * libgomp.texi (acc_attach, acc_detach): Update for Fortran
            version.
            * openacc.f90 (acc_attach{,_async},
acc_detach{,_finalize}{,_async}):
            Add.
            * openacc_lib.h: Likewise.
            * testsuite/libgomp.oacc-fortran/acc-attach-detach-1.f90: New test.
            * testsuite/libgomp.oacc-fortran/acc-attach-detach-2.f90: New test.

Reply via email to