aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/module.c
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2007-07-12 20:04:59 +0000
committerPaul Thomas <pault@gcc.gnu.org>2007-07-12 20:04:59 +0000
commit5fb70d2ea4d8e2ffb40dbb10369159e2aae1bcd1 (patch)
treeb323764db6e1598e994144a93cbef6971e5887bb /gcc/fortran/module.c
parentaa5e22f00044aff47df0997d9f5d794e91cba2dd (diff)
downloadgcc-5fb70d2ea4d8e2ffb40dbb10369159e2aae1bcd1.zip
gcc-5fb70d2ea4d8e2ffb40dbb10369159e2aae1bcd1.tar.gz
gcc-5fb70d2ea4d8e2ffb40dbb10369159e2aae1bcd1.tar.bz2
re PR fortran/32634 (renamed, use associated generic interface rejected)
2007-07-12 Paul Thomas <pault@gcc.gnu.org> PR fortran/32634 PR fortran/32727 * module.c (write_generic): Restore patch of 2007-07-10 and use symbol name if there are no use names. 2007-07-12 Paul Thomas <pault@gcc.gnu.org> PR fortran/32727 * gfortran.dg/interface_17.f90: New test. From-SVN: r126600
Diffstat (limited to 'gcc/fortran/module.c')
-rw-r--r--gcc/fortran/module.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c
index 288f1f9..31b7c9b 100644
--- a/gcc/fortran/module.c
+++ b/gcc/fortran/module.c
@@ -3947,6 +3947,9 @@ write_operator (gfc_user_op *uop)
static void
write_generic (gfc_symbol *sym)
{
+ const char *p;
+ int nuse, j;
+
if (sym->generic == NULL
|| !gfc_check_access (sym->attr.access, sym->ns->default_access))
return;
@@ -3954,7 +3957,21 @@ write_generic (gfc_symbol *sym)
if (sym->module == NULL)
sym->module = gfc_get_string (module_name);
- mio_symbol_interface (&sym->name, &sym->module, &sym->generic);
+ /* See how many use names there are. If none, use the symbol name. */
+ nuse = number_use_names (sym->name);
+ if (nuse == 0)
+ {
+ mio_symbol_interface (&sym->name, &sym->module, &sym->generic);
+ return;
+ }
+
+ for (j = 1; j <= nuse; j++)
+ {
+ /* Get the jth local name for this symbol. */
+ p = find_use_name_n (sym->name, &j);
+
+ mio_symbol_interface (&p, &sym->module, &sym->generic);
+ }
}