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

--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tobias Burnus <bur...@gcc.gnu.org>:

https://gcc.gnu.org/g:29b1587e7d34667a1fd63071c1e4f5475cd71026

commit r15-2378-g29b1587e7d34667a1fd63071c1e4f5475cd71026
Author: Tobias Burnus <tbur...@baylibre.com>
Date:   Mon Jul 29 11:46:57 2024 +0200

    OpenMP/Fortran: Fix handling of 'declare target' with 'link' clause
[PR115559]

    Contrary to a normal 'declare target', the 'declare target link' attribute
    also needs to set node->offloadable and push the offload_vars in the front
end.

    Linked variables require that the data is mapped. For module variables,
this
    can happen anywhere. For variables in an external subprograms or the main
    programm, this can only happen in the either that program itself or in an
    internal subprogram. - Whether a variable is just normally mapped or linked
then
    becomes relevant if a device routine exists that can access that variable,
    i.e. an internal procedure has then to be marked as declare target.

            PR fortran/115559

    gcc/fortran/ChangeLog:

            * trans-common.cc (build_common_decl): Add 'omp declare target' and
            'omp declare target link' variables to offload_vars.
            * trans-decl.cc (add_attributes_to_decl): Likewise; update args and
            call decl_attributes.
            (get_proc_pointer_decl, gfc_get_extern_function_decl,
            build_function_decl): Update calls.
            (gfc_get_symbol_decl): Likewise; move after 'DECL_STATIC (t)=1'
            to avoid errors with symtab_node::get_create.

    libgomp/ChangeLog:

            * testsuite/libgomp.fortran/declare-target-link.f90: New test.
  • [Bug fortran/115559] [OpenMP] '... cvs-commit at gcc dot gnu.org via Gcc-bugs

Reply via email to