diff options
author | Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> | 2004-07-11 00:37:16 +0200 |
---|---|---|
committer | Tobias Schlüter <tobi@gcc.gnu.org> | 2004-07-11 00:37:16 +0200 |
commit | 53814b8fe83f2f579f213e919b40c2793e824892 (patch) | |
tree | 71058c2b83b5ab95a6950a9d27dec8011f02a891 /gcc/fortran/symbol.c | |
parent | 77dc410393bbfeb45f0e573d57eed83d6d18ad7f (diff) | |
download | gcc-53814b8fe83f2f579f213e919b40c2793e824892.zip gcc-53814b8fe83f2f579f213e919b40c2793e824892.tar.gz gcc-53814b8fe83f2f579f213e919b40c2793e824892.tar.bz2 |
re PR fortran/16336 (ICE with common block in module)
PR fortran/16336
* decl.c (gfc_match_save): Use-associated common block
doesn't collide.
* gfortran.h (gfc_common_head): Add new field 'name'.
Fix typo in comment after #endif.
* match.c (gfc_get_common): Add new argument from_common,
mangle name if flag is set, fill in new field in structure
gfc_common_head.
(match_common): Set new arg in call to gfc_get_common,
use-associated common block doesn't collide.
* match.h (gfc_get_common): Adapt prototype.
* module.c (load_commons): Set new arg in call to
gfc_get_common.
* symbol.c (free_common_tree): New function.
(gfc_free_namespace): Call new function.
* trans-common.c (several functions): Remove argument
'name', use name from gfc_common_head instead.
From-SVN: r84476
Diffstat (limited to 'gcc/fortran/symbol.c')
-rw-r--r-- | gcc/fortran/symbol.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c index 9208d22..3159436 100644 --- a/gcc/fortran/symbol.c +++ b/gcc/fortran/symbol.c @@ -2139,6 +2139,22 @@ gfc_commit_symbols (void) } +/* Recursive function that deletes an entire tree and all the common + head structures it points to. */ + +static void +free_common_tree (gfc_symtree * common_tree) +{ + if (common_tree == NULL) + return; + + free_common_tree (common_tree->left); + free_common_tree (common_tree->right); + + gfc_free (common_tree); +} + + /* Recursive function that deletes an entire tree and all the user operator nodes that it contains. */ @@ -2216,6 +2232,7 @@ gfc_free_namespace (gfc_namespace * ns) free_sym_tree (ns->sym_root); free_uop_tree (ns->uop_root); + free_common_tree (ns->common_root); for (cl = ns->cl_list; cl; cl = cl2) { |