summaryrefslogtreecommitdiff
path: root/gcc/fortran/module.c
diff options
context:
space:
mode:
authorpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>2008-11-19 03:25:00 +0000
committerpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>2008-11-19 03:25:00 +0000
commit0c20663e1301d5b47ee66a95d5442e0373711c51 (patch)
treee4d3c15eb094e5a0086a3c78d6da347e58194382 /gcc/fortran/module.c
parent9d048317225fc63953ce4a58d13a5c9d75b8622f (diff)
downloadgcc-0c20663e1301d5b47ee66a95d5442e0373711c51.tar.gz
2008-11-19 Paul Thomas <pault@gcc.gnu.org>
PR fortran/38119 * module.c (load_equiv): Regression fix; check that equivalence members come from the same module only. 2008-11-19 Paul Thomas <pault@gcc.gnu.org> * gfortran.dg/module_equivalence_6.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@141990 138bc75d-0d04-0410-961f-82ee72b054a4
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 b9c99fe8f35..35f5ce5176d 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;