OpenACC 2.6 deep copy: Fortran front-end parts

Programming / Compilers / GCC - jules [138bc75d-0d04-0410-961f-82ee72b054a4] - 20 December 2019 01:20 UTC

gcc/fortran/
- gfortran.h (gfc_omp_map_op): Add OMP_MAP_ATTACH, OMP_MAP_DETACH.
- openmp.c (gfc_match_omp_variable_list): Add allow_derived parameter. Parse derived-type member accesses if true. (omp_mask2): Add OMP_CLAUSE_ATTACH and OMP_CLAUSE_DETACH. (gfc_match_omp_map_clause): Add allow_derived parameter. Pass to gfc_match_omp_variable_list. (gfc_match_omp_clauses): Support attach and detach. Support derived types for appropriate OpenACC directives. (OACC_PARALLEL_CLAUSES, OACC_SERIAL_CLAUSES, OACC_KERNELS_CLAUSES, OACC_DATA_CLAUSES, OACC_ENTER_DATA_CLAUSES): Add OMP_CLAUSE_ATTACH. (OACC_EXIT_DATA_CLAUSES): Add OMP_CLAUSE_DETACH. (check_symbol_not_pointer): Don't disallow pointer objects of derived type. (resolve_oacc_data_clauses): Don't disallow allocatable derived types. (resolve_omp_clauses): Perform duplicate checking only for non-derived type component accesses (plain variables and arrays or array sections). Support component refs.
- trans-expr.c (gfc_conv_component_ref, conv_parent_component_references): Make global. (gfc_maybe_dereference_var): New function, broken out of... (gfc_conv_variable): ...here. Call above function.
- trans-openmp.c (gfc_omp_privatize_by_reference): Support component refs. (gfc_trans_omp_array_section): New function, broken out of... (gfc_trans_omp_clauses): ...here. Support component refs/derived types, attach and detach clauses.
- trans.h (gfc_conv_component_ref, conv_parent_component_references, gfc_maybe_dereference_var): Add prototypes.

gcc/testsuite/
- gfortran.dg/goacc/derived-types.f90: New test.
- gfortran.dg/goacc/derived-types-2.f90: New test.
- gfortran.dg/goacc/derived-types-3.f90: New test.
- gfortran.dg/goacc/data-clauses.f95: Adjust for expected errors.
- gfortran.dg/goacc/enter-exit-data.f95: Likewise.

933d0f5bc88 OpenACC 2.6 deep copy: Fortran front-end parts
gcc/fortran/ChangeLog | 31 +++
gcc/fortran/gfortran.h | 2 +
gcc/fortran/openmp.c | 166 ++++++++----
gcc/fortran/trans-expr.c | 184 ++++++-------
gcc/fortran/trans-openmp.c | 286 ++++++++++++++++-----
gcc/fortran/trans.h | 8 +
gcc/testsuite/ChangeLog | 8 +
gcc/testsuite/gfortran.dg/goacc/data-clauses.f95 | 36 +--
.../gfortran.dg/goacc/derived-types-2.f90 | 14 +
.../gfortran.dg/goacc/derived-types-3.f90 | 12 +
gcc/testsuite/gfortran.dg/goacc/derived-types.f90 | 77 ++++++
.../gfortran.dg/goacc/enter-exit-data.f95 | 24 +-
12 files changed, 613 insertions(+), 235 deletions(-)

Upstream: gcc.gnu.org


  • Share