------- Additional Comments From jakub at redhat dot com 2005-07-22 12:37 ------- I have partly written patch, but would like to understand whether ordering matters or not. Is the following all valid f77/f90/f95? subroutine foo character*8 c character*1 d, f dimension d(2), f(2) character*4 e equivalence (c(1:1), d(1)), (c(3:5), e(2:4)), (c(6:6), f(2)) c='abcdefgh' if (c.ne.'abcdefgh'.or.d(1).ne.'a'.or.d(2).ne.'b') call abort if (e.ne.'bcde'.or.f(1).ne.'e'.or.f(2).ne.'f') call abort end subroutine foo subroutine bar equivalence (c(1:1), d(1)), (c(3:5), e(2:4)), (c(6:6), f(2)) character*8 c character*1 d, f dimension d(2), f(2) character*4 e c='abcdefgh' if (c.ne.'abcdefgh'.or.d(1).ne.'a'.or.d(2).ne.'b') call abort if (e.ne.'bcde'.or.f(1).ne.'e'.or.f(2).ne.'f') call abort end subroutine bar subroutine baz character*8 c character*1 d, f character*4 e equivalence (c(1:1), d(1)), (c(3:5), e(2:4)), (c(6:6), f(2)) dimension d(2), f(2) c='abcdefgh' if (c.ne.'abcdefgh'.or.d(1).ne.'a'.or.d(2).ne.'b') call abort if (e.ne.'bcde'.or.f(1).ne.'e'.or.f(2).ne.'f') call abort end subroutine baz subroutine another dimension d(2), f(2) equivalence (c(1:1), d(1)), (c(3:5), e(2:4)), (c(6:6), f(2)) character*8 c character*1 d, f character*4 e c='abcdefgh' if (c.ne.'abcdefgh'.or.d(1).ne.'a'.or.d(2).ne.'b') call abort if (e.ne.'bcde'.or.f(1).ne.'e'.or.f(2).ne.'f') call abort end subroutine another program main call foo call bar call baz call another end program main
Can equivalence contain sym%name or is that forbidden? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18833