diff options
author | Andre Vehreschild <vehre@gcc.gnu.org> | 2025-01-22 13:36:21 +0100 |
---|---|---|
committer | Andre Vehreschild <vehre@gcc.gnu.org> | 2025-02-20 10:31:40 +0100 |
commit | abbfeb2ecbb5e90aa5d68e489ac283348ee6b8d5 (patch) | |
tree | 083ca5aea6b36c71db228bbde6144bc3ab0c1fcf /gcc/fortran/gfortran.h | |
parent | b114312bbaae51567bc0436d07990c4fbaa3c81d (diff) | |
download | gcc-abbfeb2ecbb5e90aa5d68e489ac283348ee6b8d5.zip gcc-abbfeb2ecbb5e90aa5d68e489ac283348ee6b8d5.tar.gz gcc-abbfeb2ecbb5e90aa5d68e489ac283348ee6b8d5.tar.bz2 |
Fortran: Allow to use non-pure/non-elemental functions in coarray indexes [PR107635]
Extract calls to non-pure or non-elemental functions from index
expressions on a coarray.
gcc/fortran/ChangeLog:
PR fortran/107635
* coarray.cc (get_arrayspec_from_expr): Treat array result of
function calls correctly.
(remove_coarray_from_derived_type): Prevent memory loss.
(add_caf_get_from_remote): Correct locus.
(find_comp): New function to find or create a new component in a
derived type.
(check_add_new_comp_handle_array): Handle allocatable arrays or
non-pure/non-elemental functions in indexes of coarrays.
(check_add_new_component): Use above function.
(create_get_parameter_type): Rename to
create_caf_add_data_parameter_type.
(create_caf_add_data_parameter_type): Renaming of variable and
make the additional data a coarray.
(remove_caf_ref): Factor out to reuse in other caf-functions.
(create_get_callback): Use function factored out, set locus
correctly and ensure a kind is set for parameters.
(add_caf_get_intrinsic): Rename to add_caf_get_from_remote and
rename some variables.
(coindexed_expr_callback): Skip over function created by the
rewriter.
(coindexed_code_callback): Filter some intrinsics not to
process.
(gfc_coarray_rewrite): Rewrite also contained functions.
* trans-intrinsic.cc (gfc_conv_intrinsic_caf_get): Reflect
changed order on caf_get_from_remote ().
libgfortran/ChangeLog:
* caf/libcaf.h (_gfortran_caf_register_accessor): Reflect
changed parameter order.
* caf/single.c (struct accessor_hash_t): Same.
(_gfortran_caf_register_accessor): Call accessor using a token
for accessing arrays with a descriptor on the source side.
gcc/testsuite/ChangeLog:
* gfortran.dg/coarray_lib_comm_1.f90: Adapt scan expression.
* gfortran.dg/coarray/get_with_fn_parameter.f90: New test.
* gfortran.dg/coarray/get_with_scalar_fn.f90: New test.
Diffstat (limited to 'gcc/fortran/gfortran.h')
0 files changed, 0 insertions, 0 deletions