$ cat confused-equivalences.f real a(2), b(2), c(3) equivalence (a(1), b(2)), (b(1), c(1)), (c(2), a(2)) end $ g77 confused-equivalences.f $ g77 -v Reading specs from /usr/lib/gcc-lib/ia64-redhat-linux/3.2.3/specs Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=ia64-redhat-linux Thread model: posix gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-49)
If one of the variables is put into common, then an error is indeed generated: $ cat confused-equivalences+common.f real a(2), b(2), c(3) common c equivalence (a(1), b(2)), (b(1), c(1)), (c(2), a(2)) end $ g77 confused-equivalences+common.f Mismatched EQUIVALENCE requirements for placement of `a' at both 4 and 0 bytes offset from `_BLNK__' gfortran gets this right, which is nice: $ gfortran confused-equivalences.f In file confused-equivalences.f:1 real a(2), b(2), c(3) 2 1 Error: Inconsistent equivalence rules involving 'b' at (1) and 'a' at (2) Maybe this could be turned into a test case. -- Summary: g77: confused equivalences not detected Product: gcc Version: 3.2.3 Status: UNCONFIRMED Severity: minor Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: Thomas dot Koenig at online dot de CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19394