diff options
author | mikael <mikael@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-01-06 15:50:09 +0000 |
---|---|---|
committer | mikael <mikael@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-01-06 15:50:09 +0000 |
commit | 830f3dcc444725954858d281725546de06fc8b3a (patch) | |
tree | ca4dded937c2755d9c199ab4c9697b25287fff38 /gcc/fortran/module.c | |
parent | 2ba3f827c33d87db81d577737ab8fca343acfcad (diff) |
PR fortran/42769
PR fortran/45836
PR fortran/45900
* module.c (read_module): Don't reuse local symtree if the associated
symbol isn't exactly the one wanted. Don't reuse local symtree if it is
ambiguous.
* resolve.c (resolve_call): Use symtree's name instead of symbol's to
lookup the symtree.
PR fortran/42769
PR fortran/45836
PR fortran/45900
* gfortran.dg/use_23.f90: New test.
* gfortran.dg/use_24.f90: New test.
* gfortran.dg/use_25.f90: New test.
* gfortran.dg/use_26.f90: New test.
* gfortran.dg/use_27.f90: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@194949 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/module.c')
-rw-r--r-- | gcc/fortran/module.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c index e19c6d9d71f8..f3b3caa1ad81 100644 --- a/gcc/fortran/module.c +++ b/gcc/fortran/module.c @@ -4663,8 +4663,14 @@ read_module (void) if (p == NULL) { st = gfc_find_symtree (gfc_current_ns->sym_root, name); - if (st != NULL) - info->u.rsym.symtree = st; + if (st != NULL + && strcmp (st->n.sym->name, info->u.rsym.true_name) == 0 + && st->n.sym->module != NULL + && strcmp (st->n.sym->module, info->u.rsym.module) == 0) + { + info->u.rsym.symtree = st; + info->u.rsym.sym = st->n.sym; + } continue; } @@ -4685,7 +4691,8 @@ read_module (void) /* Check for ambiguous symbols. */ if (check_for_ambiguous (st->n.sym, info)) st->ambiguous = 1; - info->u.rsym.symtree = st; + else + info->u.rsym.symtree = st; } else { |