aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorMikael Morin <mikael@gcc.gnu.org>2013-01-06 15:50:09 +0000
committerMikael Morin <mikael@gcc.gnu.org>2013-01-06 15:50:09 +0000
commitd932cea872a9146317fcb54a5957ef46bae4e107 (patch)
treeca4dded937c2755d9c199ab4c9697b25287fff38 /gcc/fortran
parent9d1818902c053258956c3b8562d29afba4889e86 (diff)
downloadgcc-d932cea872a9146317fcb54a5957ef46bae4e107.zip
gcc-d932cea872a9146317fcb54a5957ef46bae4e107.tar.gz
gcc-d932cea872a9146317fcb54a5957ef46bae4e107.tar.bz2
re PR fortran/42769 ([OOP] ICE in resolve_typebound_procedure)
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. From-SVN: r194949
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog11
-rw-r--r--gcc/fortran/module.c13
-rw-r--r--gcc/fortran/resolve.c2
3 files changed, 22 insertions, 4 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 37dad52..f08f9b4 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,14 @@
+2013-01-06 Mikael Morin <mikael@gcc.gnu.org>
+
+ 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.
+
2013-01-05 Steven G. Kargl <kargl@gcc.gnu.org>
Mikael Morin <mikael@gcc.gnu.org>
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c
index e19c6d9..f3b3caa 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
{
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 54ac3c6..b81f231 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -3776,7 +3776,7 @@ resolve_call (gfc_code *c)
if (csym && gfc_current_ns->parent && csym->ns != gfc_current_ns)
{
gfc_symtree *st;
- gfc_find_sym_tree (csym->name, gfc_current_ns, 1, &st);
+ gfc_find_sym_tree (c->symtree->name, gfc_current_ns, 1, &st);
sym = st ? st->n.sym : NULL;
if (sym && csym != sym
&& sym->ns == gfc_current_ns