public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/38859]  New: ubound and lbound treat structure component references as whole arrays
@ 2009-01-15 19:47 dick dot hendrickson at gmail dot com
  2009-01-15 20:04 ` [Bug fortran/38859] [4.3/4.4 Regression] " burnus at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: dick dot hendrickson at gmail dot com @ 2009-01-15 19:47 UTC (permalink / raw)
  To: gcc-bugs

The UBOUND and LBOUND intrinsics treat a reference to an array structure
component as if they were inquires on a whole array.  

Dick Hendrickson


       program try_jg_15_18

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

       type x
         integer I
       end type x
       type (x) A(0:5, 2:8)
       integer ida(2)

       ida = lbound(a)
       if (any(ida /= (/0,2/))) print *, 'base array', ida

!note that a%i is neither a whole array nor an array structure component

       ida = lbound(a%i)
       if (any(ida /= (/1,1/))) print *, 'lbound    ', ida

       ida = ubound(a)
       if (any(ida /= (/6,7/))) print *, 'ubound    ', ida

       end


C:\gfortran>gfortran try_jg_15_18.f

C:\gfortran>a
 lbound               0           2
 ubound               5           8


-- 
           Summary: ubound and lbound treat structure component references
                    as whole arrays
           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=38859


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

end of thread, other threads:[~2009-01-26  5:45 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-15 19:47 [Bug fortran/38859] New: ubound and lbound treat structure component references as whole arrays dick dot hendrickson at gmail dot com
2009-01-15 20:04 ` [Bug fortran/38859] [4.3/4.4 Regression] " burnus at gcc dot gnu dot org
2009-01-15 20:11 ` burnus at gcc dot gnu dot org
2009-01-15 21:30 ` mikael at gcc dot gnu dot org
2009-01-17 15:00 ` mikael at gcc dot gnu dot org
2009-01-17 15:45 ` burnus at gcc dot gnu dot org
2009-01-19 22:20 ` mikael at gcc dot gnu dot org
2009-01-20  5:55 ` [Bug fortran/38859] [4.3 " pault at gcc dot gnu dot org
2009-01-26  5:44 ` pault at gcc dot gnu dot org
2009-01-26  5:45 ` 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).