The ASSOCIATED functions returns false for the 4th test below.  It
should return true.  there have been a ton of interps and rewording
of the associated function.  It's probably clearer to read
case (v) in the F2003 standard.

      program try_mg0028
! fails on Windows XP
! gcc version 4.4.0 20080312 (experimental) [trunk revision 133139]

      real  tda2r(2,3)

      call       mg0028(tda2r,  1,  2,  3)

      end


      SUBROUTINE MG0028(TDA2R,nf1,nf2,nf3)
      real, pointer  ::  TLA2L(:,:),TLA2L1(:,:)
      real, target   ::  TDA2R(NF2,NF3)
      logical LL(4)
      TLA2L => TDA2R(NF2:NF1:-NF2,NF3:NF1:-NF2)
      TLA2L1 => TLA2L
      LL(1) = ASSOCIATED(TLA2L)
      LL(2) = ASSOCIATED(TLA2L,TLA2L1)
      LL(3) = ASSOCIATED(TLA2L,TDA2R)
      LL(4) = ASSOCIATED(TLA2L1,TDA2R(2:2,3:1:-2))  !should be true

      if (any(LL .neqv. (/ .true., .true., .false., .true./))) then
        print *, LL
        print *, shape(TLA2L1)
        print *, shape(TDA2R(2:2,3:1:-2))
      endif

      END SUBROUTINE


C:\g_experiments\gfortran>gfortran m
g0028.f

C:\g_experiments\gfortran>a
 T T F F
           1           2
           1           2


-- 
           Summary: ASSOCIATED returns false when strides confusing
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dick dot hendrickson at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35721

Reply via email to