With gfortran 4.3.0 20080109 I get the error message

     ALLOCATE (RLA1(NF10), STAT = ISTAT)
                                      1
Error: STAT expression at (1) must be a variable

With the following program.

     MODULE TESTS
     INTEGER, PRIVATE :: ISTAT       !this one FAILS
!      INTEGER :: ISTAT               !this one works
!      PRIVATE :: ISTAT               !this one FAILS
     CONTAINS
     SUBROUTINE AD0001
     REAL RLA1(:)
     ALLOCATABLE RLA1
     ISTAT = -314
     ALLOCATE (RLA1(NF10), STAT = ISTAT)
     END SUBROUTINE
     END MODULE

In the real module there are several subroutines that do similar
allocates and they do not generate the error.  It looks like it is
only the first use of ISTAT in an allocate that triggers the message.

Dick Hendrickson


-- 
           Summary: PRIVATE variable not allowed as STAT variable in
                    ALLOCATE
           Product: gcc
           Version: 4.3.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=34760

Reply via email to