diff options
author | Daniel Kraft <d@domob.eu> | 2008-09-01 15:43:10 +0200 |
---|---|---|
committer | Daniel Kraft <domob@gcc.gnu.org> | 2008-09-01 15:43:10 +0200 |
commit | 3e1e5626dc66aa2bf4a2529b4aa842741d726340 (patch) | |
tree | 0fc3cb984d5be7e10c9ff226b82425a557ec7801 /gcc/fortran/module.c | |
parent | 51c69ddb914f062d93c2180a293c944107fbf999 (diff) | |
download | gcc-3e1e5626dc66aa2bf4a2529b4aa842741d726340.zip gcc-3e1e5626dc66aa2bf4a2529b4aa842741d726340.tar.gz gcc-3e1e5626dc66aa2bf4a2529b4aa842741d726340.tar.bz2 |
re PR fortran/37193 ("USE mod, ONLY: i, i=>j" does not import "i")
2008-09-01 Daniel Kraft <d@domob.eu>
PR fortran/37193
* module.c (read_module): Initialize use_only flag on used symbols.
2008-09-01 Daniel Kraft <d@domob.eu>
PR fortran/37193
* gfortran.dg/use_rename_4.f90: New test.
* gfortran.dg/use_rename_5.f90: New test.
From-SVN: r139866
Diffstat (limited to 'gcc/fortran/module.c')
-rw-r--r-- | gcc/fortran/module.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c index c927803..907002b 100644 --- a/gcc/fortran/module.c +++ b/gcc/fortran/module.c @@ -4094,9 +4094,9 @@ read_module (void) st = gfc_find_symtree (gfc_current_ns->sym_root, name); /* Delete the symtree if the symbol has been added by a USE - statement without an ONLY(11.3.2). Remember that the rsym + statement without an ONLY(11.3.2). Remember that the rsym will be the same as the symbol found in the symtree, for - this case.*/ + this case. */ if (st && (only_flag || info->u.rsym.renamed) && !st->n.sym->attr.use_only && !st->n.sym->attr.use_rename @@ -4132,6 +4132,11 @@ read_module (void) if (strcmp (name, p) != 0) sym->attr.use_rename = 1; + /* We need to set the only_flag here so that symbols from the + same USE...ONLY but earlier are not deleted from the tree in + the gfc_delete_symtree above. */ + sym->attr.use_only = only_flag; + /* Store the symtree pointing to this symbol. */ info->u.rsym.symtree = st; |