]> git.ipfire.org Git - thirdparty/gcc.git/commit
Support Fortran 2003 class pointers in OpenACC
authorJulian Brown <julian@codesourcery.com>
Wed, 20 Feb 2019 13:21:15 +0000 (05:21 -0800)
committerThomas Schwinge <thomas@codesourcery.com>
Tue, 3 Mar 2020 11:49:59 +0000 (12:49 +0100)
commit5031a0790d1c95001eac4e487101e08c4af3382b
tree462216f2be99ec9c764b8cad3a59661c84ed0609
parentc68bbcbc64200458e9992cfc64edb31c834ecf70
Support Fortran 2003 class pointers in OpenACC

gcc/
* gimplify.c (insert_struct_comp_map): Handle GOMP_MAP_ATTACH_DETACH.
(gimplify_scan_omp_clauses): Separate out handling of OACC_ENTER_DATA
and OACC_EXIT_DATA. Remove GOMP_MAP_POINTER and GOMP_MAP_TO_PSET
mappings, apart from those following GOMP_MAP_DECLARE_{,DE}ALLOCATE.
Handle GOMP_MAP_ATTACH_DETACH.
* tree-pretty-print.c (dump_omp_clause): Support GOMP_MAP_ATTACH_DETACH.
Print "bias" not "len" for attach/detach clause types.

include/
* gomp-constants.h (gomp_map_kind): Add GOMP_MAP_ATTACH_DETACH.

gcc/c/
* c-typeck.c (handle_omp_array_sections): Use GOMP_MAP_ATTACH_DETACH
for OpenACC attach/detach operations.

gcc/cp/
* semantics.c (handle_omp_array_sections): Likewise.
(finish_omp_clauses): Handle GOMP_MAP_ATTACH_DETACH.

gcc/fortran/
* openmp.c (resolve_oacc_data_clauses): Allow polymorphic allocatable
variables.
* trans-expr.c (gfc_conv_component_ref,
conv_parent_component_reference): Make global.
(gfc_auto_dereference_var): New function, broken out of...
(gfc_conv_variable): ...here. Call outlined function instead.
* trans-openmp.c (gfc_trans_omp_array_section): New function, broken out
of...
(gfc_trans_omp_clauses): ...here. Separate out OpenACC derived
type/polymorphic class pointer handling. Call above outlined function.
* trans.h (gfc_conv_component_ref, conv_parent_component_references,
gfc_auto_dereference_var): Add prototypes.

gcc/testsuite/
* c-c++-common/goacc/mdc-1.c: Update clause matching patterns.

libgomp/
* oacc-parallel.c (GOACC_enter_exit_data): Fix optional arguments for
changes to clause stripping in enter data/exit data directives.
* testsuite/libgomp.oacc-fortran/class-ptr-param.f95: New test.
* testsuite/libgomp.oacc-fortran/classtypes-1.f95: New test.
* testsuite/libgomp.oacc-fortran/classtypes-2.f95: New test.
* testsuite/libgomp.oacc-fortran/derivedtype-1.f95: New test.
* testsuite/libgomp.oacc-fortran/derivedtype-2.f95: New test.
* testsuite/libgomp.oacc-fortran/multidim-slice.f95: New test.

(cherry picked from openacc-gcc-9-branch commit
3c260613f2e74d6639c4dbd43b018b6640ae8454)
24 files changed:
gcc/ChangeLog.omp
gcc/c/ChangeLog.omp
gcc/c/c-typeck.c
gcc/cp/ChangeLog.omp
gcc/cp/semantics.c
gcc/fortran/ChangeLog.omp
gcc/fortran/openmp.c
gcc/fortran/trans-expr.c
gcc/fortran/trans-openmp.c
gcc/fortran/trans.h
gcc/gimplify.c
gcc/testsuite/ChangeLog.omp
gcc/testsuite/c-c++-common/goacc/mdc-1.c
gcc/tree-pretty-print.c
include/ChangeLog.omp
include/gomp-constants.h
libgomp/ChangeLog.omp
libgomp/oacc-parallel.c
libgomp/testsuite/libgomp.oacc-fortran/class-ptr-param.f95 [new file with mode: 0644]
libgomp/testsuite/libgomp.oacc-fortran/classtypes-1.f95 [new file with mode: 0644]
libgomp/testsuite/libgomp.oacc-fortran/classtypes-2.f95 [new file with mode: 0644]
libgomp/testsuite/libgomp.oacc-fortran/derivedtype-1.f95 [new file with mode: 0644]
libgomp/testsuite/libgomp.oacc-fortran/derivedtype-2.f95 [new file with mode: 0644]
libgomp/testsuite/libgomp.oacc-fortran/multidim-slice.f95 [new file with mode: 0644]