OpenMP] Fix use_device_… with absent optional arg
authorTobias Burnus <tobias@codesourcery.com>
Thu, 5 Dec 2019 15:18:39 +0000 (15:18 +0000)
committerTobias Burnus <burnus@gcc.gnu.org>
Thu, 5 Dec 2019 15:18:39 +0000 (16:18 +0100)
commitc3cb71ef35522f46afa6f11ee376cdcb73b893e8
tree00586bccd3b51836b13802be9977e0024a9a7476
parent705f02b0ca8e625c4f513a66efe28b403c796c22
OpenMP] Fix use_device_… with absent optional arg

        gcc/fortran/
        * trans-openmp.c (gfc_omp_is_optional_argument,
        gfc_omp_check_optional_argument): Handle type(c_ptr),value which uses a
        hidden argument for the is-present check.

        gcc/
        * omp-low.c (lower_omp_target): For use_device_ptr/use_derice_addr
        and Fortran's optional arguments, unconditionally add the is-present
        condition before the libgomp call.

        libgomp/
        * testsuite/libgomp.fortran/use_device_ptr-optional-2.f90: Add
        'type(c_ptr), value' test case. Conditionally map the per-value
        passed arguments.

From-SVN: r279004
gcc/ChangeLog
gcc/fortran/ChangeLog
gcc/fortran/trans-openmp.c
gcc/omp-low.c
gcc/testsuite/ChangeLog
libgomp/testsuite/libgomp.fortran/use_device_ptr-optional-2.f90