Wrong array section bounds when passing to an intent-in pointer dummy.
Add code to allow for the creation a new descriptor for array
sections with the correct one based indexing.
Rework the generated descriptors indexing (hopefully) fixing the
wrong offsets generated.
gcc/fortran/ChangeLog:
2020-06-11 José Rui Faustino de Sousa <jrfsousa@gmail.com>
PR fortran/52351
PR fortran/85868
* trans-array.c (gfc_conv_expr_descriptor): Enable the
creation of a new descriptor with the correct one based
indexing for array sections. Rework array descriptor
indexing offset calculation.
gcc/testsuite/ChangeLog:
2020-06-11 José Rui Faustino de Sousa <jrfsousa@gmail.com>
PR fortran/52351
PR fortran/85868
* gfortran.dg/coarray_lib_comm_1.f90: Adjust match test for
the newly generated descriptor.
* gfortran.dg/PR85868A.f90: New test.
* gfortran.dg/PR85868B.f90: New test.