aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/parse.cc
diff options
context:
space:
mode:
authorMikael Morin <mikael@gcc.gnu.org>2023-09-15 13:40:08 +0200
committerMikael Morin <mikael@gcc.gnu.org>2023-09-15 13:43:43 +0200
commite6dba708c8627080f4ca776590a191683b38336c (patch)
treeebfba85db2b31786c2bd21a3500a3fd177369c73 /gcc/fortran/parse.cc
parentb259284ee135a432e0097d923d0908350f74f468 (diff)
downloadgcc-e6dba708c8627080f4ca776590a191683b38336c.zip
gcc-e6dba708c8627080f4ca776590a191683b38336c.tar.gz
gcc-e6dba708c8627080f4ca776590a191683b38336c.tar.bz2
fortran: Remove reference count update [PR108957]
Remove one reference count incrementation following the assignment of a symbol pointer to a local variable. Most symbol pointers are "weak" pointer and don't need any reference count update when they are assigned, and it is especially the case of local variables. This fixes a memory leak with the testcase from the PR (not included). PR fortran/108957 gcc/fortran/ChangeLog: * gfortran.h (gfc_symbol): Add comment documenting reference counting. * parse.cc (parse_interface): Remove reference count incrementation.
Diffstat (limited to 'gcc/fortran/parse.cc')
-rw-r--r--gcc/fortran/parse.cc3
1 files changed, 0 insertions, 3 deletions
diff --git a/gcc/fortran/parse.cc b/gcc/fortran/parse.cc
index 8f09ddf..5838680 100644
--- a/gcc/fortran/parse.cc
+++ b/gcc/fortran/parse.cc
@@ -4064,9 +4064,6 @@ loop:
accept_statement (st);
prog_unit = gfc_new_block;
prog_unit->formal_ns = gfc_current_ns;
- if (prog_unit == prog_unit->formal_ns->proc_name
- && prog_unit->ns != prog_unit->formal_ns)
- prog_unit->refs++;
decl:
/* Read data declaration statements. */