public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/94109] [8/9/10/11 Regression] Memory leak introduced in 8.3.0->8.3.1 Date: Sun, 14 Jun 2020 12:06:57 +0000 [thread overview] Message-ID: <bug-94109-4-rKXLdyh5x1@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-94109-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94109 --- Comment #17 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-9 branch has been updated by Thomas Kथà¤nig <tkoenig@gcc.gnu.org>: https://gcc.gnu.org/g:9224bcfd6a4edf61e371e2d83fb126c948182cba commit r9-8676-g9224bcfd6a4edf61e371e2d83fb126c948182cba Author: Thomas Koenig <tkoenig@gcc.gnu.org> Date: Sun Jun 14 13:50:48 2020 +0200 When avoiding double deallocation, look at namespace, expression and component. Our finalization handling is a mess. Really, we should get to try and get this fixed for gcc 11. In the meantime, here is a patch which fixes a regression I introduced when fixing a regression with a memory leak. The important thing here is to realize that we do not need to finalize (and deallocate) multiple times for the same expression and the same component in the same namespace. It might cause code size regressions, but better big code than wrong code... Backported from r11-1296-g1af22e455584ef5fcad2b4474c1efc3fd26f6cb3 . gcc/fortran/ChangeLog: PR fortran/94109 * class.c (finalize_component): Return early if finalization has already happened for expression and component within namespace. * gfortran.h (gfc_was_finalized): New type. (gfc_namespace): Add member was_finalzed. (gfc_expr): Remove finalized. * symbol.c (gfc_free_namespace): Free was_finalized. gcc/testsuite/ChangeLog: PR fortran/94109 * gfortran.dg/finalize_34.f90: Adjust free counts. * gfortran.dg/finalize_36.f90: New test.
next prev parent reply other threads:[~2020-06-14 12:06 UTC|newest] Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-03-09 19:31 [Bug fortran/94109] New: " antony at cosmologist dot info 2020-04-11 19:01 ` [Bug fortran/94109] " tkoenig at gcc dot gnu.org 2020-04-11 19:04 ` antony at cosmologist dot info 2020-05-04 9:27 ` antony at cosmologist dot info 2020-05-18 15:47 ` antony at cosmologist dot info 2020-06-01 19:49 ` tkoenig at gcc dot gnu.org 2020-06-03 8:11 ` antony at cosmologist dot info 2020-06-03 11:17 ` antony at cosmologist dot info 2020-06-03 12:31 ` tkoenig at gcc dot gnu.org 2020-06-03 13:23 ` dominiq at lps dot ens.fr 2020-06-03 14:55 ` tkoenig at gcc dot gnu.org 2020-06-04 9:27 ` antony at cosmologist dot info 2020-06-04 10:45 ` antony at cosmologist dot info 2020-06-04 12:34 ` tkoenig at gcc dot gnu.org 2020-06-07 9:56 ` [Bug fortran/94109] [8/9/10/11 Regression] " tkoenig at gcc dot gnu.org 2020-06-07 13:54 ` tkoenig at gcc dot gnu.org 2020-06-14 11:03 ` cvs-commit at gcc dot gnu.org 2020-06-14 11:45 ` cvs-commit at gcc dot gnu.org 2020-06-14 12:06 ` cvs-commit at gcc dot gnu.org [this message] 2020-06-14 12:07 ` cvs-commit at gcc dot gnu.org 2020-06-14 12:09 ` tkoenig at gcc dot gnu.org 2020-06-14 20:37 ` antony at cosmologist dot info 2020-06-14 21:27 ` tkoenig at gcc dot gnu.org 2020-06-15 18:54 ` tkoenig at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-94109-4-rKXLdyh5x1@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).