Fix coarray rank for non-coarrays in derived types. [PR86468]
The corank was propagated to array components in derived types. Fix this by setting a zero corank when the array component is not a pointer. For pointer typed array components propagate the corank of the derived type to allow associating the component to a coarray. gcc/fortran/ChangeLog: PR fortran/86468 * trans-intrinsic.cc (conv_intrinsic_move_alloc): Correct comment. * trans-types.cc (gfc_sym_type): Pass coarray rank, not false. (gfc_get_derived_type): Only propagate codimension for coarrays and pointers to array components in derived typed coarrays. gcc/testsuite/ChangeLog: * gfortran.dg/coarray_lib_this_image_2.f90: Fix array rank in tree dump scan. * gfortran.dg/coarray_lib_token_4.f90: Same. * gfortran.dg/coarray/move_alloc_2.f90: New test.
Showing
- gcc/fortran/trans-intrinsic.cc 1 addition, 1 deletiongcc/fortran/trans-intrinsic.cc
- gcc/fortran/trans-types.cc 11 additions, 7 deletionsgcc/fortran/trans-types.cc
- gcc/testsuite/gfortran.dg/coarray/move_alloc_2.f90 55 additions, 0 deletionsgcc/testsuite/gfortran.dg/coarray/move_alloc_2.f90
- gcc/testsuite/gfortran.dg/coarray_lib_this_image_2.f90 1 addition, 1 deletiongcc/testsuite/gfortran.dg/coarray_lib_this_image_2.f90
- gcc/testsuite/gfortran.dg/coarray_lib_token_4.f90 2 additions, 2 deletionsgcc/testsuite/gfortran.dg/coarray_lib_token_4.f90
Loading
Please register or sign in to comment