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, OOP] PR 79311: ICE in generate_finalization_wrapper, at fortran/class.c:1992


Hi all,

the attached patch fixes an ICE-on-valid problem with finalization by
making sure that the finalization procedures are properly resolved.

In the test case, the finalizer of the component type was not being
resolved if the superordinate type had a finalizer itself.

The patch also fixes a small error that had no actual impact on the
test case ('has_final2' could never become true).

Regtesting went well, except for these three failure which also seems
to occur on a clean trunk currently:

FAIL: gfortran.dg/coarray_lock_7.f90   -O   scan-tree-dump-times original
FAIL: gfortran.dg/coarray_lock_7.f90   -O   scan-tree-dump-times original
FAIL: gfortran.dg/mvbits_7.f90   -O0   (test for warnings, line 28)

Ok for trunk?

Cheers,
Janus



2017-05-08  Janus Weil  <janus@gcc.gnu.org>

    PR fortran/79311
    * resolve.c (gfc_resolve_finalizers): Ensure that derived-type
    components have a their finalizers resolved, also if the superordinate
    type itself has a finalizer.

2017-05-08  Janus Weil  <janus@gcc.gnu.org>

    PR fortran/79311
    * gfortran.dg/finalize_32.f90: New test.

Attachment: pr79311.diff
Description: Text document

! { dg-do compile }
!
! PR 79311: [OOP] ICE in generate_finalization_wrapper, at fortran/class.c:1992
!
! Contributed by DIL <liakhdi@ornl.gov>

module tensor_recursive
  implicit none

  type :: tens_signature_t
  contains
    final :: tens_signature_dtor
  end type

  type :: tens_header_t
    type(tens_signature_t) :: signature
  contains
    final :: tens_header_dtor
  end type

contains

  subroutine tens_signature_dtor(this)
    type(tens_signature_t) :: this
  end subroutine

  subroutine tens_header_dtor(this)
    type(tens_header_t) :: this
  end subroutine

end

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