]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fix OpenMP's use_device_ptr with Fortran array descriptors
authorTobias Burnus <tobias@codesourcery.com>
Wed, 9 Oct 2019 20:26:19 +0000 (22:26 +0200)
committerThomas Schwinge <thomas@codesourcery.com>
Tue, 3 Mar 2020 11:51:25 +0000 (12:51 +0100)
commitc7dd28cba553ec729bcc60b1388fa77881731243
tree82d83a2174da46edfc56f159ef820d1cb08f3a10
parent4f4c1ea2d278ee5050b32e0a9d429b060c6eaddb
Fix OpenMP's use_device_ptr with Fortran array descriptors

        gcc/fortran
        * f95-lang.c (LANG_HOOKS_OMP_ARRAY_DATA): Set to gfc_omp_array_data.
        * trans-array.c (gfc_conv_descriptor_data_get): Handle ref types.
        * trans-openmp.c (gfc_omp_array_data): New.
        * trans.h (gfc_omp_array_data): Declare.

        gcc/
        * hooks.c (hook_tree_tree_null): New.
        * hooks.h (hook_tree_tree_null): Declare.
        * langhooks-def.h (LANG_HOOKS_OMP_ARRAY_DATA): Define.
        (LANG_HOOKS_FOR_TYPES_INITIALIZER): Use it.
        * langhooks.h (lang_hooks_for_types): Add omp_array_data.
        * omp-general.c (omp_is_optional_argument): Handle value+optional.
        * omp-low.c (omp_context): Add array_data_map + present_map.
        (install_var_field): Handle array descriptors.
        (delete_omp_context): Free new maps.
        (scan_sharing_clauses): Handle array descriptors.
        (lower_omp_target): Ditto. Fix optional-arg present check.

        gcc/testsuite/
        * gfortran.dg/gomp/use_device_ptr1.f90: New.
        * gfortran.dg/gomp/use_device_ptr2.f90: New.
        * gfortran.dg/gomp/use_device_ptr3.f90: New.

        libgomp/
        * testsuite/libgomp.fortran/use_device_ptr1.f90: New.

(cherry picked from openacc-gcc-9-branch commit
d13968ca4a60e3edb24bf61eac1a15bacb66406a)
18 files changed:
gcc/ChangeLog.omp
gcc/fortran/ChangeLog.omp
gcc/fortran/f95-lang.c
gcc/fortran/trans-array.c
gcc/fortran/trans-openmp.c
gcc/fortran/trans.h
gcc/hooks.c
gcc/hooks.h
gcc/langhooks-def.h
gcc/langhooks.h
gcc/omp-general.c
gcc/omp-low.c
gcc/testsuite/ChangeLog.omp
gcc/testsuite/gfortran.dg/gomp/use_device_ptr1.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/use_device_ptr2.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/use_device_ptr3.f90 [new file with mode: 0644]
libgomp/ChangeLog.omp
libgomp/testsuite/libgomp.fortran/use_device_ptr1.f90 [new file with mode: 0644]