OpenMP] use_device_addr/use_device_ptr with Fortran allocatable/pointer arrays
authorTobias Burnus <tobias@codesourcery.com>
Fri, 1 Nov 2019 07:59:23 +0000 (07:59 +0000)
committerTobias Burnus <burnus@gcc.gnu.org>
Fri, 1 Nov 2019 07:59:23 +0000 (08:59 +0100)
commit92e63bd2dfefb2d27bc235523bec6740bba512c2
tree67d9cd0a57317909a139256fdb8379003b5f67b8
parent271da732841345d3834cf458d47f8242ac5ef513
OpenMP] use_device_addr/use_device_ptr with Fortran allocatable/pointer arrays

        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 also
        REFERENCE_TYPE.
        * trans-openmp.c (gfc_omp_array_data): New.
        * trans.h (gfc_omp_array_data): New prototype.

        gcc/
        * hooks.c (hook_tree_tree_bool_null): New.
        * hooks.h (hook_tree_tree_bool_null): Declare.
        * langhooks-def.h (LANG_HOOKS_OMP_ARRAY_DATA): Define.
        (LANG_HOOKS_DECLS): Add it.
        * langhooks.h (lang_hooks_for_decls): Add omp_array_data.
        * omp-low.c (install_var_field): New mode for Fortran descriptor arrays.
        (lower_omp_target): Handle Fortran array with descriptor in
        OMP_CLAUSE_USE_DEVICE_ADDR/OMP_CLAUSE_USE_DEVICE_PTR.

        libgomp/
        * testsuite/libgomp.fortran/use_device_addr-1.f90 (test_nullptr_1,
        test_dummy_opt_nullptr_callee_1): Add present but unallocated test.
        * testsuite/libgomp.fortran/use_device_addr-2.f90: Likewise.
        * testsuite/libgomp.fortran/use_device_addr-3.f90: New.
        * testsuite/libgomp.fortran/use_device_addr-4.f90: New.
        * testsuite/testsuite/libgomp.fortran/use_device_ptr-1.f90: New.

From-SVN: r277705
17 files changed:
gcc/ChangeLog
gcc/fortran/ChangeLog
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-low.c
libgomp/ChangeLog
libgomp/testsuite/libgomp.fortran/use_device_addr-1.f90
libgomp/testsuite/libgomp.fortran/use_device_addr-2.f90
libgomp/testsuite/libgomp.fortran/use_device_addr-3.f90 [new file with mode: 0644]
libgomp/testsuite/libgomp.fortran/use_device_addr-4.f90 [new file with mode: 0644]
libgomp/testsuite/libgomp.fortran/use_device_ptr-1.f90 [new file with mode: 0644]