------- Additional Comments From federico dot carminati at cern dot ch 2005-07-22 13:42 ------- Subject: Re: ICE 'missing spec' on integer/char equivalence
Hello, this is valid f90/95 code. Equivalence cannot contain sym%val as far as I understand, but they can cointain derived types as long as they are sequenced. Best regards, Fed On 22 Jul 2005, at 14:37, jakub at redhat dot com wrote: > > ------- 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 > > ------- You are receiving this mail because: ------- > You are on the CC list for the bug, or are watching someone who is. > -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18833