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/35960] New: run time abort with assignment of RESHAPEd zero sized array


Each line of the following subroutine causes a run-time
abort. Except for the one labeled gf1069.  It works if
literal constants are used in place of the nf* variables.

Dick Hendrickson

      program try_gf1065


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


      call       gf1065(1,  2,  3,  4,  7,  8,  9)
      end

      SUBROUTINE GF1065(nf1,nf2,nf3,nf4,nf7,nf8,nf9)
!        also 1066 thru 1070, 1069 works

      REAL RDA(10,9)
      REAL RCA1(90)
      integer ila(2)
!gf1065
      RDA(NF9:NF8, NF7:NF3) = RESHAPE(RCA1,(/0,0/), (/1.0/),(/2,1/))
      print *, 'gf1065'

!gf1066
      rDA(NF9:NF8, NF7:NF3) = RESHAPE(rCA1,(/0,0/),ORDER=(/2,1/))
      print *, 'gf1066'

      ILA(1) = 5
      ILA(2) = 0
!gf1067
      rDA(NF4:NF8, NF7:NF3) = RESHAPE(rcA1,ILA)
      print *, 'gf1067'

!gf1068
      RdA(NF4:NF8, NF7:NF3) = RESHAPE(RcA1,ILA,PAD=(/-1.0/))
      print *, 'gf1068'

      ILA(1) = 0
      ILA(2) = 5
!gf1069    this one works
      RdA(NF9:NF8,NF4:NF8)=RESHAPE(RcA1,ILA,(/-1.0/),(/NF2,NF1/))
      print *, 'gf1069'

      ILA(1) = 5
      ILA(2) = 0
!gf1070
      RdA(NF4:NF8, NF7:NF3) = RESHAPE(RcA1,ILA,ORDER=(/NF1,NF2/))
      print *, 'gf1070'


      END SUBROUTINE


C:\gfortran:gfortran gf1065.f

C:\gfortran:a
Fortran runtime error: shape and target do not conform


-- 
           Summary: run time abort with assignment of RESHAPEd zero sized
                    array
           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=35960


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