[OpenMP/OpenACC/Fortran] Fix mapping of optional (present|absent) arguments
authorTobias Burnus <tobias@codesourcery.com>
Fri, 6 Dec 2019 13:06:53 +0000 (13:06 +0000)
committerTobias Burnus <burnus@gcc.gnu.org>
Fri, 6 Dec 2019 13:06:53 +0000 (14:06 +0100)
commit6e4d01d61f2bec57a247de1c5ee538f122ec34a8
treeca87082ee159a2583e98c36758a14a6e66b9b9c9
parente150da383346adc762bc904342f9877f2f071265
[OpenMP/OpenACC/Fortran] Fix mapping of optional (present|absent) arguments

2019-12-06  Tobias Burnus  <tobias@codesourcery.com>
            Kwok Cheung Yeung <kcy@codesourcery.com>

        gcc/fortran/
        * trans-openmp.c (gfc_build_conditional_assign,
        gfc_build_conditional_assign_expr): New static functions.
        (gfc_omp_finish_clause, gfc_trans_omp_clauses): Handle mapping of
        absent optional arguments and fix mapping of present optional args.

        gcc/
        * omp-low.c (lower_omp_target): For optional arguments, deref once
        more to obtain the type.

        libgomp/
        * oacc-mem.c (update_dev_host, gomp_acc_insert_pointer): Just return
        if input it a NULL pointer.
        * testsuite/libgomp.oacc-c-c++-common/lib-43.c: Remove; dependent on
        diagnostic of NULL pointer.
        * testsuite/libgomp.oacc-c-c++-common/lib-47.c: Ditto.
        * testsuite/libgomp.fortran/optional-map.f90: New.
        * testsuite/libgomp.fortran/use_device_addr-1.f90
        (test_dummy_opt_callee_1_absent): New.
        (test_dummy_opt_call_1): Call it.
        * testsuite/libgomp.fortran/use_device_addr-2.f90: Likewise.
        * testsuite/libgomp.fortran/use_device_addr-3.f90: Likewise.
        * testsuite/libgomp.fortran/use_device_addr-4.f90: Likewise.
        * testsuite/libgomp.oacc-fortran/optional-cache.f95: New.
        * testsuite/libgomp.oacc-fortran/optional-data-copyin-by-value.f90: New.
        * testsuite/libgomp.oacc-fortran/optional-data-copyin.f90: New.
        * testsuite/libgomp.oacc-fortran/optional-data-copyout.f90: New.
        * testsuite/libgomp.oacc-fortran/optional-data-enter-exit.f90: New.
        * testsuite/libgomp.oacc-fortran/optional-declare.f90: New.
        * testsuite/libgomp.oacc-fortran/optional-firstprivate.f90: New.
        * testsuite/libgomp.oacc-fortran/optional-host_data.f90: New.
        * testsuite/libgomp.oacc-fortran/optional-nested-calls.f90: New.
        * testsuite/libgomp.oacc-fortran/optional-private.f90: New.
        * testsuite/libgomp.oacc-fortran/optional-reduction.f90: New.
        * testsuite/libgomp.oacc-fortran/optional-update-device.f90: New.
        * testsuite/libgomp.oacc-fortran/optional-update-host.f90: New.

Co-Authored-By: Kwok Cheung Yeung <kcy@codesourcery.com>
From-SVN: r279043
26 files changed:
gcc/ChangeLog
gcc/fortran/ChangeLog
gcc/fortran/trans-openmp.c
gcc/omp-low.c
libgomp/ChangeLog
libgomp/oacc-mem.c
libgomp/testsuite/libgomp.fortran/optional-map.f90 [new file with mode: 0644]
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
libgomp/testsuite/libgomp.fortran/use_device_addr-4.f90
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-43.c [deleted file]
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-47.c [deleted file]
libgomp/testsuite/libgomp.oacc-fortran/optional-cache.f95 [new file with mode: 0644]
libgomp/testsuite/libgomp.oacc-fortran/optional-data-copyin-by-value.f90 [new file with mode: 0644]
libgomp/testsuite/libgomp.oacc-fortran/optional-data-copyin.f90 [new file with mode: 0644]
libgomp/testsuite/libgomp.oacc-fortran/optional-data-copyout.f90 [new file with mode: 0644]
libgomp/testsuite/libgomp.oacc-fortran/optional-data-enter-exit.f90 [new file with mode: 0644]
libgomp/testsuite/libgomp.oacc-fortran/optional-declare.f90 [new file with mode: 0644]
libgomp/testsuite/libgomp.oacc-fortran/optional-firstprivate.f90 [new file with mode: 0644]
libgomp/testsuite/libgomp.oacc-fortran/optional-host_data.f90 [new file with mode: 0644]
libgomp/testsuite/libgomp.oacc-fortran/optional-nested-calls.f90 [new file with mode: 0644]
libgomp/testsuite/libgomp.oacc-fortran/optional-private.f90 [new file with mode: 0644]
libgomp/testsuite/libgomp.oacc-fortran/optional-reduction.f90 [new file with mode: 0644]
libgomp/testsuite/libgomp.oacc-fortran/optional-update-device.f90 [new file with mode: 0644]
libgomp/testsuite/libgomp.oacc-fortran/optional-update-host.f90 [new file with mode: 0644]