public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/35960]  New: run time abort with assignment of RESHAPEd zero sized array
@ 2008-04-16 21:19 dick dot hendrickson at gmail dot com
  2008-04-17 21:59 ` [Bug fortran/35960] " tkoenig at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: dick dot hendrickson at gmail dot com @ 2008-04-16 21:19 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-04-25 20:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-16 21:19 [Bug fortran/35960] New: run time abort with assignment of RESHAPEd zero sized array dick dot hendrickson at gmail dot com
2008-04-17 21:59 ` [Bug fortran/35960] " tkoenig at gcc dot gnu dot org
2008-04-19 11:30 ` tkoenig at gcc dot gnu dot org
2008-04-19 14:12 ` tkoenig at gcc dot gnu dot org
2008-04-20 19:57 ` tkoenig at gcc dot gnu dot org
2008-04-20 20:08 ` tkoenig at gcc dot gnu dot org
2008-04-25 20:12 ` tkoenig at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).