re PR fortran/70752 (Incorrect LEN for ALLOCATABLE CHARACTER)
authorPaul Thomas <pault@gcc.gnu.org>
Sun, 30 Sep 2018 12:22:07 +0000 (12:22 +0000)
committerPaul Thomas <pault@gcc.gnu.org>
Sun, 30 Sep 2018 12:22:07 +0000 (12:22 +0000)
commitba08c70a0c73b9fef5b78e2e5706845aa85c4df7
tree52932d1b845b28c268d7a49e53166ffcfb5b5e55
parentf1525dd4b4c4e57e8dd6f1c1a90f1a148b3da945
re PR fortran/70752 (Incorrect LEN for ALLOCATABLE CHARACTER)

2018-09-30  Paul Thomas  <pault@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
if the latter is not a variable type. If it is a variable do
an assignment. 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-30  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/70752
PR fortran/72709
* gfortran.dg/deferred_character_25.f90 : New test.
* gfortran.dg/deferred_character_26.f90 : New test.
* gfortran.dg/deferred_character_27.f90 : New test to verify
that PR82617 remains fixed.

From-SVN: r264724
gcc/fortran/ChangeLog
gcc/fortran/trans-array.c
gcc/fortran/trans.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/deferred_character_25.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/deferred_character_26.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/deferred_character_27.f90 [new file with mode: 0644]