public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/38852]  New: UBOUND fails for negative stride triplets
@ 2009-01-14 22:00 dick dot hendrickson at gmail dot com
  2009-01-14 22:08 ` [Bug fortran/38852] " dominiq at lps dot ens dot fr
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: dick dot hendrickson at gmail dot com @ 2009-01-14 22:00 UTC (permalink / raw)
  To: gcc-bugs

The UBOUND function returns zero for subscript triplets that have a negative
stride, such as 5:4:-1.  Fails with both compile-time expressions and run-time
expressions.  LBOUND and SHAPE work correctly on the same triplets.

This might be related to 35685 since I think this started soon after 35685 was
closed.

Dick Hendrickson


      program try_je0031

! fails on Windows XP
! gcc version 4.4.0 20081219 (experimental) [trunk revision 142842] (GCC)

      integer ida(4)
      real dda(5,5,5,5,5)
      call JE0031(IDA,DDA,2,5,-2)

      end 

      SUBROUTINE JE0031(IDA,DDA,nf2,nf5,mf2)
      INTEGER IDA(4)
      REAL DLA(:,:,:,:)
      REAL DDA(5,5,5,5,5)
      POINTER DLA
      TARGET DDA

      DLA => DDA(2:3, 1:3:2, 5:4:-1, NF2, NF5:NF2:MF2)
      IDA = UBOUND(DLA)
      if (any(ida /= 2)) print *, '    run-time ubound', ida

      DLA => DDA(2:3, 1:3:2, 5:4:-1, 2, 5:2:-2)
      IDA = UBOUND(DLA)
      if (any(ida /= 2)) print *, 'compile-time ubound', ida

!these work
      DLA => DDA(2:3, 1:3:2, 5:4:-1, 2, 5:2:-2)
      IDA = shape(DLA)
      if (any(ida /= 2)) print *, ' compile-time shape', ida

      DLA => DDA(2:3, 1:3:2, 5:4:-1, 2, 5:2:-2)
      IDA = LBOUND(DLA)
      if (any(ida /= 1)) print *, 'compile-time lbound', ida

      END SUBROUTINE


C:\gfortran>gfortran try_je0031.f

C:\gfortran>a
     run-time ubound           2           2           0           0
 compile-time ubound           2           2           0           0


-- 
           Summary: UBOUND fails for negative stride triplets
           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=38852


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

end of thread, other threads:[~2009-02-19  6:44 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-14 22:00 [Bug fortran/38852] New: UBOUND fails for negative stride triplets dick dot hendrickson at gmail dot com
2009-01-14 22:08 ` [Bug fortran/38852] " dominiq at lps dot ens dot fr
2009-01-15  5:56 ` jv244 at cam dot ac dot uk
2009-01-15  5:58 ` jv244 at cam dot ac dot uk
2009-01-19 18:48 ` mikael at gcc dot gnu dot org
2009-01-20 22:30 ` mikael at gcc dot gnu dot org
2009-01-22 12:40 ` pault at gcc dot gnu dot org
2009-01-25 18:22 ` pault at gcc dot gnu dot org
2009-01-25 21:08 ` pault at gcc dot gnu dot org
2009-01-27 12:16 ` [Bug fortran/38852] [Fix pending] " pault at gcc dot gnu dot org
2009-01-28 17:31 ` pault at gcc dot gnu dot org
2009-01-28 17:33 ` pault at gcc dot gnu dot org
2009-01-28 20:52 ` pault at gcc dot gnu dot org
2009-01-28 21:49 ` pault at gcc dot gnu dot org
2009-01-28 21:52 ` [Bug fortran/38852] [4.3] " pault at gcc dot gnu dot org
2009-02-19  6:44 ` pault at gcc dot gnu dot org
2009-02-19  6:44 ` pault 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).