This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch, fortran] PR64932 [4.9/5 Regression] ICE in gfc_conv_descriptor_data_get for generated finalizer


Dear All,

This is a slight development of the patch posted on the PR itself.

class.c(finalize_component) is not able to deal correctly with
non-allocatable, derived type array components that have allocatable
components. Rather than generating loops in finalize_component,  the
condition is detected in trans-stmt.c(gfc_trans_deallocate) and
gfc_deallocate_alloc_comp is called after obtaining the derived type
for the array and checking that it is not finalizable.

Happily, this fix does not generate the error:
Error: Two or more part references with nonzero rank must not be
specified at (1)
which occurs if the code is written explicitly.

Bootstraps and regtests on FC21/x86_64

OK for trunk and 4.9?

Paul

2015-02-07  Paul Thomas  <pault@gcc.gnu.org>

    PR fortran/64932
    * trans-stmt.c (gfc_trans_deallocate): If a component array
    expression is not a descriptor type and it is a derived type
    that has allocatable components and is not finalizable, then
    deallocate the allocatable components.

2015-02-07  Paul Thomas  <pault@gcc.gnu.org>

    PR fortran/6432
    * gfortran.dg/finalize_28.f90: New test

Attachment: submit.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]