From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D968E3851C36; Mon, 1 Jun 2020 18:16:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D968E3851C36 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1591035360; bh=w3h14ey14jPQEdT5eMsyrEWe+3CUqmVqNbFAkJ86aF4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=IY4QbKho0gWPAW12oOeOiwlxIIk+BsuMvC+vao9c7dGNvJpcMPH63ut3Vq9ZDd7bl 2AQhghCvKiBpUJnIUVoyrkjWdc1D/62jELZ1RBJsYl6sKStO6s+a0M5gjFrk3d0wLh Y25H0FJEUMdW07qIucRCmZWadgQdv8khjhMp0zKY= 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:16:00 +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:16:01 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94361 --- Comment #7 from CVS Commits --- The releases/gcc-10 branch has been updated by Thomas K=C3=A0=C2=A4=C2=A5= =C3=A0=C2=A4nig : https://gcc.gnu.org/g:b703627d668257c0955a43838288e91973bf2721 commit r10-8218-gb703627d668257c0955a43838288e91973bf2721 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)=