+2019-02-09 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/89200
+ * trans-array.c (gfc_trans_create_temp_array): Set the 'span'
+ field for derived types.
+
2019-02-04 Harald Anlauf <anlauf@gmx.de>
PR fortran/89077
tmp = gfc_conv_descriptor_dtype (desc);
gfc_add_modify (pre, tmp, gfc_get_dtype (TREE_TYPE (desc)));
+ /* Also set the span for derived types, since they can be used in
+ component references to arrays of this type. */
+ if (TREE_CODE (eltype) == RECORD_TYPE)
+ {
+ tmp = TYPE_SIZE_UNIT (eltype);
+ tmp = fold_convert (gfc_array_index_type, tmp);
+ gfc_conv_descriptor_span_set (pre, desc, tmp);
+ }
+
/*
Fill in the bounds and stride. This is a packed array, so:
+2019-02-09 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/89200
+ * gfortran.dg/array_reference_2.f90 : New test.
+
2019-02-09 Jakub Jelinek <jakub@redhat.com>
PR middle-end/89246
--- /dev/null
+! { dg-do run }
+!
+! Test the fix for PR89200, in which the indexing did not work in
+! the write statement below.
+!
+! Contributed by Damian Rouson <damian@sourceryinstitute.org>
+!
+ type foo
+ character(len=:), allocatable :: string
+ end type
+ type foo_list
+ type(foo), allocatable :: entry(:)
+ end type
+ type(foo_list) list
+ character(4) :: buffer
+ list = foo_list([foo('12'), foo('34')])
+ write(buffer, '(2a2)') list%entry(1)%string, list%entry(2)%string
+ if (buffer .ne. '1234') stop 1
+ deallocate (list%entry)
+end