diff options
author | Janus Weil <janus@gcc.gnu.org> | 2011-02-02 20:51:03 +0100 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2011-02-02 19:51:03 +0000 |
commit | 8e2bc95be59aa82767921fe0b83e0da93caaa611 (patch) | |
tree | ffaee50911754a7de580e03aa7a2d82de33596ed /gcc/fortran/module.c | |
parent | 932e32375ae90a7ca6d146efccf7e87b820f032a (diff) | |
download | gcc-8e2bc95be59aa82767921fe0b83e0da93caaa611.zip gcc-8e2bc95be59aa82767921fe0b83e0da93caaa611.tar.gz gcc-8e2bc95be59aa82767921fe0b83e0da93caaa611.tar.bz2 |
re PR fortran/47082 ([OOP] ICE in gfc_conv_component_ref)
2011-02-02 Janus Weil <janus@gcc.gnu.org>
Paul Thomas <pault@gcc.gnu.org>
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 <janus@gcc.gnu.org>
Paul Thomas <pault@gcc.gnu.org>
PR fortran/47082
* gfortran.dg/class_37.f03 : New test.
Co-Authored-By: Paul Thomas <pault@gcc.gnu.org>
From-SVN: r169767
Diffstat (limited to 'gcc/fortran/module.c')
-rw-r--r-- | gcc/fortran/module.c | 16 |
1 files changed, 15 insertions, 1 deletions
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++; |