aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/module.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/module.c')
-rw-r--r--gcc/fortran/module.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c
index b9c99fe..35f5ce5 100644
--- a/gcc/fortran/module.c
+++ b/gcc/fortran/module.c
@@ -3807,12 +3807,14 @@ load_equiv (void)
}
/* Unused equivalence members have a unique name. In addition, it
- must be checked that the symbol is that from the module. */
+ must be checked that the symbols are from the same module. */
unused = true;
for (eq = head; eq; eq = eq->eq)
{
if (eq->expr->symtree->n.sym->module
- && strcmp (module_name, eq->expr->symtree->n.sym->module) == 0
+ && head->expr->symtree->n.sym->module
+ && strcmp (head->expr->symtree->n.sym->module,
+ eq->expr->symtree->n.sym->module) == 0
&& !check_unique_name (eq->expr->symtree->name))
{
unused = false;