This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [Patch, Fortran, OOP] PR 61767: ICE in generate_finalization_wrapper at fortran/class.c:1491
- From: Andre Vehreschild <vehre at gmx dot de>
- To: Janus Weil <janus at gcc dot gnu dot org>
- Cc: gfortran <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 8 Dec 2016 14:10:36 +0100
- Subject: Re: [Patch, Fortran, OOP] PR 61767: ICE in generate_finalization_wrapper at fortran/class.c:1491
- Authentication-results: sourceware.org; auth=none
- References: <CAKwh3qjNHZAGSkMw_wvwduyEWHVyknPDorbrG0-AxyDiJ3pmXw@mail.gmail.com>
Hi Janus,
so when I interpret the testcase correctly, than the finalizer should not be
called, right? So adding a call abort() in the Finalize and allocating and
deallocating M in the main program should do no harm, but make the testcase IMO
more feasible. What do you think?
- Andre
On Thu, 8 Dec 2016 13:56:29 +0100
Janus Weil <janus@gcc.gnu.org> wrote:
> Hi all,
>
> the attached patch fixes an ice-on-valid problem with finalization.
> The ICE turned out to be caused by a bug in 'has_finalizer_component':
> According to the documentation, this function is supposed to detect
> whether a derived type has any nonpointer nonallocatable components
> that have a finalizer. However it triggered also on pointer components
> with a finalizer. Fixing this makes the ICE go away.
>
> The patch regtests cleanly on x86_64-linux-gnu. Ok for trunk?
>
> Cheers,
> Janus
>
>
> 2016-12-08 Janus Weil <janus@gcc.gnu.org>
>
> PR fortran/61767
> * class.c (has_finalizer_component): Fix this function to detect only
> non-pointer non-allocatable components which have a finalizer.
>
> 2016-12-08 Janus Weil <janus@gcc.gnu.org>
>
> PR fortran/61767
> * gfortran.dg/finalize_31.f90: New test.
--
Andre Vehreschild * Email: vehre ad gmx dot de