From 8e2bc95be59aa82767921fe0b83e0da93caaa611 Mon Sep 17 00:00:00 2001 From: Janus Weil Date: Wed, 2 Feb 2011 20:51:03 +0100 Subject: re PR fortran/47082 ([OOP] ICE in gfc_conv_component_ref) 2011-02-02 Janus Weil Paul Thomas PR fortran/47082 * trans-expr.c (gfc_trans_class_init_assign): Add call to gfc_get_derived_type. * module.c (read_cleanup): Do not use unique_symtrees for vtabs or vtypes. 2011-02-02 Janus Weil Paul Thomas PR fortran/47082 * gfortran.dg/class_37.f03 : New test. Co-Authored-By: Paul Thomas From-SVN: r169767 --- gcc/fortran/module.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'gcc/fortran/module.c') diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c index 6c3455b..267809c 100644 --- a/gcc/fortran/module.c +++ b/gcc/fortran/module.c @@ -4219,9 +4219,23 @@ read_cleanup (pointer_info *p) if (p->type == P_SYMBOL && p->u.rsym.state == USED && !p->u.rsym.referenced) { + gfc_namespace *ns; /* Add hidden symbols to the symtree. */ q = get_integer (p->u.rsym.ns); - st = gfc_get_unique_symtree ((gfc_namespace *) q->u.pointer); + ns = (gfc_namespace *) q->u.pointer; + + if (!p->u.rsym.sym->attr.vtype + && !p->u.rsym.sym->attr.vtab) + st = gfc_get_unique_symtree (ns); + else + { + /* There is no reason to use 'unique_symtrees' for vtabs or + vtypes - their name is fine for a symtree and reduces the + namespace pollution. */ + st = gfc_find_symtree (ns->sym_root, p->u.rsym.sym->name); + if (!st) + st = gfc_new_symtree (&ns->sym_root, p->u.rsym.sym->name); + } st->n.sym = p->u.rsym.sym; st->n.sym->refs++; -- cgit v1.1