diff options
author | koenigni <koenigni@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-04-04 13:41:41 +0000 |
---|---|---|
committer | koenigni <koenigni@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-04-04 13:41:41 +0000 |
commit | 82a299afd7736cc1b5aaacebe4139cd1630abc60 (patch) | |
tree | 47ead797c2864d6fb28699977ba4feebd71787e9 /gcc/fortran | |
parent | 5821cbd2fa002acf67add968862c6d4fe847fa89 (diff) | |
download | gcc-82a299afd7736cc1b5aaacebe4139cd1630abc60.tar.gz |
2017-03-18 Nicolas Koenig <koenigni@student.ethz.ch>
PR fortran/69498
* symbol.c (gfc_delete_symtree): If there is a period in the name, ignore
everything before it.
2017-03-18 Nicolas Koenig <koenigni@student.ethz.ch>
PR fortran/69498
* gfortran.dg/submodule_unexp.f90: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@246679 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/symbol.c | 14 |
2 files changed, 18 insertions, 2 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 7528f37a020..e1057d72eb8 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2017-03-18 Nicolas Koenig <koenigni@student.ethz.ch> + + PR fortran/69498 + * symbol.c (gfc_delete_symtree): If there is a period in the name, ignore + everything before it. + 2017-03-28 Janus Weil <janus@gcc.gnu.org> PR fortran/78661 diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c index 6226bca7bec..ec43e635bf3 100644 --- a/gcc/fortran/symbol.c +++ b/gcc/fortran/symbol.c @@ -2782,10 +2782,20 @@ void gfc_delete_symtree (gfc_symtree **root, const char *name) { gfc_symtree st, *st0; + const char *p; - st0 = gfc_find_symtree (*root, name); + /* Submodules are marked as mod.submod. When freeing a submodule + symbol, the symtree only has "submod", so adjust that here. */ - st.name = gfc_get_string ("%s", name); + p = strrchr(name, '.'); + if (p) + p++; + else + p = name; + + st0 = gfc_find_symtree (*root, p); + + st.name = gfc_get_string ("%s", p); gfc_delete_bbt (root, &st, compare_symtree); free (st0); |