This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/35719] New: pointer to zero sized array not associated


The ASSOCIATED function returns FALSE when its argument is a
pointer to a zero-sized array.

Dick Hendrickson

      program try_mf1053

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

      call       mf1053 (  1,   2,   3,   4)
      end

      SUBROUTINE MF1053 (nf1, nf2, nf3, nf4)
      INTEGER, pointer :: ILA(:,:)
      INTEGER, target  :: ILA1(NF2,NF4:NF3)

      ILA => ILA1

      if (ASSOCIATED (ILA, ILA1(NF1:NF2,NF4:NF3) ) ) print *, "1 bad"
      if ( .not. ASSOCIATED(ILA) )  print *, "2 bad"

      END SUBROUTINE

C:\g_experiments\gfortran>gfortran mf1053.f

C:\g_experiments\gfortran>a
 2 bad


-- 
           Summary: pointer to zero sized array not associated
           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=35719


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]