Committed as 'obvious' in revision 268721 after bootstrapping and regtesting.

Even if not entirely obvious to the world at large, the patch is, in
the words of Hitch Hikers Guide to the Galaxy, "mostly harmless".

To explain the 'obviousness': Array and structure constructors make
use of temporary descriptors, which are sometimes copied into the
destination. Array referencing has been tightened up so that more use
is being made of pointer arithmetic involving the 'span' field to
obtain the stride measure. This is especially important in the case of
references to components of derived type array elements, as in the
testcase.

It should be noted that the testcase leaks memory as in PR38319. Since
it is an especially clear case, I might take a quick peek to see if I
can fix this PR at long last.

Paul

2019-02-09  Paul Thomas  <pa...@gcc.gnu.org>

    PR fortran/89200
    * trans-array.c (gfc_trans_create_temp_array): Set the 'span'
    field for derived types.

2019-02-09  Paul Thomas  <pa...@gcc.gnu.org>

    PR fortran/89200
    * gfortran.dg/array_reference_2.f90 : New test.

Reply via email to