From: pault Date: Wed, 19 Nov 2008 03:25:00 +0000 (+0000) Subject: 2008-11-19 Paul Thomas X-Git-Url: http://git.sourceforge.jp/view?a=commitdiff_plain;h=0c20663e1301d5b47ee66a95d5442e0373711c51;p=pf3gnuchains%2Fgcc-fork.git 2008-11-19 Paul Thomas PR fortran/38119 * module.c (load_equiv): Regression fix; check that equivalence members come from the same module only. 2008-11-19 Paul Thomas * 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 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 69d8df28def..352cc318002 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2008-11-19 Paul Thomas + + PR fortran/38119 + * module.c (load_equiv): Regression fix; check that equivalence + members come from the same module only. + 2008-11-16 Mikael Morin PR fortran/35681 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; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4f49d7fe214..135ca37db58 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2008-11-19 Paul Thomas + + * gfortran.dg/module_equivalence_6.f90: New test. + 2008-11-18 Jakub Jelinek PR tree-optimization/38051 diff --git a/gcc/testsuite/gfortran.dg/module_equivalence_6.f90 b/gcc/testsuite/gfortran.dg/module_equivalence_6.f90 new file mode 100644 index 00000000000..8c8049e46be --- /dev/null +++ b/gcc/testsuite/gfortran.dg/module_equivalence_6.f90 @@ -0,0 +1,22 @@ +! { dg-do compile } +! +! Fixes PR38171 a regression caused by the fix for PR37706. +! +! Contributed by Scot Breitenfeld +! +MODULE H5GLOBAL + IMPLICIT NONE + INTEGER :: H5P_flags + INTEGER :: H5P_DEFAULT_F + EQUIVALENCE(H5P_flags, H5P_DEFAULT_F) +END MODULE H5GLOBAL +MODULE HDF5 + USE H5GLOBAL +END MODULE HDF5 +PROGRAM fortranlibtest + USE HDF5 + IMPLICIT NONE + INTEGER :: ii + ii = H5P_DEFAULT_F +END PROGRAM fortranlibtest +! { dg-final { cleanup-modules "H5GLOBAL HD5" } }