diff options
author | Mikael Morin <mikael@gcc.gnu.org> | 2015-03-08 11:52:51 +0000 |
---|---|---|
committer | Mikael Morin <mikael@gcc.gnu.org> | 2015-03-08 11:52:51 +0000 |
commit | 511820a8dc2a5f750cadd76456f4aac4dd0b640d (patch) | |
tree | 2e967917def23592876cee5ad306e34bf540e115 /gcc/fortran/resolve.c | |
parent | 9e09e4ac1c81c10f79254d7e2308b34f4b7cce83 (diff) | |
download | gcc-511820a8dc2a5f750cadd76456f4aac4dd0b640d.zip gcc-511820a8dc2a5f750cadd76456f4aac4dd0b640d.tar.gz gcc-511820a8dc2a5f750cadd76456f4aac4dd0b640d.tar.bz2 |
re PR fortran/60898 (model compile error with gfortran 4.7 and gcc 4.9)
PR fortran/60898
fortran/
* resolve.c (resolve_symbol): Check that the symbol found by
name lookup really is the current symbol being resolved.
testsuite/
* gfortran.dg/entry_20.f90: New.
From-SVN: r221262
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r-- | gcc/fortran/resolve.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 675cb15..942a9ad 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -13125,10 +13125,13 @@ resolve_symbol (gfc_symbol *sym) { this_symtree = gfc_find_symtree (gfc_current_ns->sym_root, sym->name); - gfc_release_symbol (sym); - symtree->n.sym->refs++; - this_symtree->n.sym = symtree->n.sym; - return; + if (this_symtree->n.sym == sym) + { + symtree->n.sym->refs++; + gfc_release_symbol (sym); + this_symtree->n.sym = symtree->n.sym; + return; + } } } |