OSDN Git Service

2008-11-19 Paul Thomas <pault@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / fortran / module.c
index b9c99fe..35f5ce5 100644 (file)
@@ -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;