diff options
| author | Paul Thomas <pault@gcc.gnu.org> | 2006-12-09 20:52:27 +0000 |
|---|---|---|
| committer | Paul Thomas <pault@gcc.gnu.org> | 2006-12-09 20:52:27 +0000 |
| commit | 1027275d2e6e9c34d1703406111ca2d7cab150dc (patch) | |
| tree | e1bb0983bc4f7aef81f313ba20585da56a4b546a /gcc/fortran/module.c | |
| parent | 4d4074e415dbf2029f49bef9fe48ed79c8c5a106 (diff) | |
| download | gcc-1027275d2e6e9c34d1703406111ca2d7cab150dc.zip gcc-1027275d2e6e9c34d1703406111ca2d7cab150dc.tar.gz gcc-1027275d2e6e9c34d1703406111ca2d7cab150dc.tar.bz2 | |
re PR fortran/29464 ([4.1 only] problem with duplicate USE, ONLY of procedure in INTERFACE)
2006-11-25 Paul Thomas <pault@gcc.gnu.org>
PR fortran/29464
* module.c (load_generic_interfaces): Add symbols for all the
local names of an interface. Share the interface amongst the
symbols.
* gfortran.h : Add generic_copy to symbol_attribute.
* symbol.c (free_symbol): Only free interface if generic_copy
is not set.
2006-11-25 Paul Thomas <pault@gcc.gnu.org>
PR fortran/29464
* gfortran.dg/module_interface_2.f90: New test.
From-SVN: r119696
Diffstat (limited to 'gcc/fortran/module.c')
| -rw-r--r-- | gcc/fortran/module.c | 44 |
1 files changed, 30 insertions, 14 deletions
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c index 6956fc9..7c9c2b1 100644 --- a/gcc/fortran/module.c +++ b/gcc/fortran/module.c @@ -3024,6 +3024,8 @@ load_generic_interfaces (void) const char *p; char name[GFC_MAX_SYMBOL_LEN + 1], module[GFC_MAX_SYMBOL_LEN + 1]; gfc_symbol *sym; + gfc_interface *generic = NULL; + int n, i; mio_lparen (); @@ -3034,25 +3036,39 @@ load_generic_interfaces (void) mio_internal_string (name); mio_internal_string (module); - /* Decide if we need to load this one or not. */ - p = find_use_name (name); + n = number_use_names (name); + n = n ? n : 1; - if (p == NULL || gfc_find_symbol (p, NULL, 0, &sym)) + for (i = 1; i <= n; i++) { - while (parse_atom () != ATOM_RPAREN); - continue; - } + /* Decide if we need to load this one or not. */ + p = find_use_name_n (name, &i); - if (sym == NULL) - { - gfc_get_symbol (p, NULL, &sym); + if (p == NULL || gfc_find_symbol (p, NULL, 0, &sym)) + { + while (parse_atom () != ATOM_RPAREN); + continue; + } - sym->attr.flavor = FL_PROCEDURE; - sym->attr.generic = 1; - sym->attr.use_assoc = 1; - } + if (sym == NULL) + { + gfc_get_symbol (p, NULL, &sym); - mio_interface_rest (&sym->generic); + sym->attr.flavor = FL_PROCEDURE; + sym->attr.generic = 1; + sym->attr.use_assoc = 1; + } + if (i == 1) + { + mio_interface_rest (&sym->generic); + generic = sym->generic; + } + else + { + sym->generic = generic; + sym->attr.generic_copy = 1; + } + } } mio_rparen (); |
