]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fortran: Remove adding and removing of caf_get. [PR107635]
authorAndre Vehreschild <vehre@gcc.gnu.org>
Thu, 31 Oct 2024 14:35:47 +0000 (15:35 +0100)
committerAndre Vehreschild <vehre@gcc.gnu.org>
Sun, 22 Dec 2024 15:28:29 +0000 (16:28 +0100)
commit91d52f87c5bc48eacaf305d515e7cce192c2cf9c
tree38e504e8c638e034562bb6602f5fba0c9ad3c67d
parentd9d92b1c1b418dc5f8298cd75f8bdd5b0bfa9837
Fortran: Remove adding and removing of caf_get. [PR107635]

Preparatory work for PR107635.

During resolve prevent adding caf_get calls for expressions on the
left-hand-side of an assignment and removing them later on again.

Furthermore has the caf_token in a component become a pointer to
the component and not the backend_decl of the caf-component.
In some cases the caf_token was added as last component in a derived
type and not as the next one following the component that it was
needed to be associated to.

gcc/fortran/ChangeLog:

PR fortran/107635

* gfortran.h (gfc_comp_caf_token): Convenient macro for
accessing caf_token's tree.
* resolve.cc (gfc_resolve_ref): Backup caf_lhs when resolving
expr in array_ref.
(remove_caf_get_intrinsic): Removed.
(resolve_variable): Set flag caf_lhs when resolving lhs of
assignment to prevent insertion of caf_get.
(resolve_lock_unlock_event): Same, but the lhs is the parameter.
(resolve_ordinary_assign): Move conversion to caf_send to
resolve_codes.
(resolve_codes): Adress caf_get and caf_send here.
(resolve_fl_derived0): Set component's caf_token when token is
necessary.
* trans-array.cc (gfc_conv_array_parameter): Get a coarray for
expression that have a corank.
(structure_alloc_comps): Use macro to get caf_token's tree.
(gfc_alloc_allocatable_for_assignment): Same.
* trans-expr.cc (gfc_get_ultimate_alloc_ptr_comps_caf_token):
Same.
(gfc_trans_structure_assign): Same.
* trans-intrinsic.cc (conv_expr_ref_to_caf_ref): Same.
(has_ref_after_cafref): New function to figure that after a
reference of a coarray another reference is present.
(conv_caf_send): Get rhs from correct place, when caf_get is
not removed.
* trans-types.cc (gfc_get_derived_type): Get caf_token from
component and no longer guessing.
gcc/fortran/gfortran.h
gcc/fortran/resolve.cc
gcc/fortran/trans-array.cc
gcc/fortran/trans-expr.cc
gcc/fortran/trans-intrinsic.cc
gcc/fortran/trans-types.cc