Paul Richard Thomas
2018-09-25 17:06:28 UTC
This patch is a bit more complicated than some of the previous posts.
However, the ChangeLog explains the story pretty clearly.
Bootstraps and regtests on FC21/x86_64 - OK for trunk and 8-branch?
Again, better names for the testcases will be determined before committing.
Paul
2018-09-25 Paul Thomas <***@gcc.gnu.org>
PR fortran/70752
PR fortran/72709
* trans-array.c (gfc_conv_scalarized_array_ref): If this is a
deferred type and the info->descriptor is present, use the
info->descriptor
(gfc_conv_array_ref): Is the se expr is a descriptor type, pass
it as 'decl' rather than the symbol backend_decl.
(gfc_array_allocate): If the se string_length is a component
reference, fix it and use it for the expression string length.
Make use of component ref string lengths to set the descriptor
'span'.
(gfc_conv_expr_descriptor): For pointer assignment, do not set
the span field if gfc_get_array_span returns zero.
* trans.c (get_array_span): If the upper bound a character type
is zero, use the descriptor span if available.
2018-09-25 Paul Thomas <***@gcc.gnu.org>
PR fortran/70752
* gfortran.dg/pr70752.f90 : New test.
PR fortran/72709
* gfortran.dg/pr72709.f90 : New test.
However, the ChangeLog explains the story pretty clearly.
Bootstraps and regtests on FC21/x86_64 - OK for trunk and 8-branch?
Again, better names for the testcases will be determined before committing.
Paul
2018-09-25 Paul Thomas <***@gcc.gnu.org>
PR fortran/70752
PR fortran/72709
* trans-array.c (gfc_conv_scalarized_array_ref): If this is a
deferred type and the info->descriptor is present, use the
info->descriptor
(gfc_conv_array_ref): Is the se expr is a descriptor type, pass
it as 'decl' rather than the symbol backend_decl.
(gfc_array_allocate): If the se string_length is a component
reference, fix it and use it for the expression string length.
Make use of component ref string lengths to set the descriptor
'span'.
(gfc_conv_expr_descriptor): For pointer assignment, do not set
the span field if gfc_get_array_span returns zero.
* trans.c (get_array_span): If the upper bound a character type
is zero, use the descriptor span if available.
2018-09-25 Paul Thomas <***@gcc.gnu.org>
PR fortran/70752
* gfortran.dg/pr70752.f90 : New test.
PR fortran/72709
* gfortran.dg/pr72709.f90 : New test.