From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A85073851C36; Mon, 1 Jun 2020 18:33:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A85073851C36 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1591036393; bh=lJ+JJcSeWuXUtjG5sIFSlLyTDs2evloSG8noAxTAMUQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=gS/sBFhnJR1vfTuejsac22yhGNtAyB4gxoqVX+XdGP7NjE4Wt732mAEu1siyZ0Sm5 7fMxFI//8BYhSDIRX3xE7FmXJeNA5bSkxrk4uK/LItpFEE1T5mlPk0c+r2dUphdJwe K6MmI8FEBYGvtky2j8BDwKgU0jH6WG05CbfzFMS0= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/94361] [8/9/10/11 Regression] Memory leak in nested types with final Date: Mon, 01 Jun 2020 18:33:13 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 10.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: tkoenig at gcc dot gnu.org X-Bugzilla-Target-Milestone: 8.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2020 18:33:13 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94361 --- Comment #8 from CVS Commits --- The releases/gcc-9 branch has been updated by Thomas K=C3=A0=C2=A4=C2=A5=C3= =A0=C2=A4nig : https://gcc.gnu.org/g:2a0de88ccf2ecc6659b0f1e4580c1ce5cff976b3 commit r9-8643-g2a0de88ccf2ecc6659b0f1e4580c1ce5cff976b3 Author: Thomas Koenig Date: Sun May 31 10:26:40 2020 +0200 Finalization depends on the expression, not on the component. This patch fixes a 8/9/10/11 regression, where finalized types were not finalized (and deallocated), which led to memory leaks. gcc/fortran/ChangeLog: 2020-05-24 Thomas Koenig PR fortran/94361 * class.c (finalize_component): Use expr->finalized instead of comp->finalized. * gfortran.h (gfc_component): Remove finalized member. (gfc_expr): Add it here instead. gcc/testsuite/ChangeLog: 2020-05-24 Thomas Koenig PR fortran/94361 * gfortran.dg/finalize_28.f90: Adjusted free counts. * gfortran.dg/finalize_33.f90: Likewise. * gfortran.dg/finalize_34.f90: Likewise. * gfortran.dg/finalize_35.f90: New test. (cherry picked from commit 811f902b764c5a13178cbd7588e96c16b3fab504)=