public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/38324]  New: Wrong lbound given to allocatable components
@ 2008-11-30  7:50 pault at gcc dot gnu dot org
  2008-12-01 13:55 ` [Bug fortran/38324] " dominiq at lps dot ens dot fr
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: pault at gcc dot gnu dot org @ 2008-11-30  7:50 UTC (permalink / raw)
  To: gcc-bugs

This was identified in comment #13 of PR34143 and is not fixed by the patch for
that PR.

The problem of conversion shows up even without -fdefault-integer-8 along with
bound problems as shown by the following code:

integer, parameter :: ik=4
type :: struct
   integer(4), allocatable :: ib(:)
end type struct
integer, parameter :: from=-1, to=2
integer(ik), allocatable :: ia(:)
type(struct) :: x
allocate(ia(from:to))
print *, 'bounds, full array           ', lbound(ia), ubound(ia)
print *, 'bounds, full implicit section', lbound(ia(:)), ubound(ia(:))
print *, 'bounds, full explicit section', lbound(ia(from:to)),
ubound(ia(from:to))
print *, 'derived type, ik=', ik
x=struct(ia)
print *, 'bounds, full array           ', lbound(x%ib), ubound(x%ib)
x=struct(ia(:))
print *, 'bounds, full implicit section', lbound(x%ib), ubound(x%ib)
x=struct(ia(from:to))
print *, 'bounds, full explicit section', lbound(x%ib), ubound(x%ib)
deallocate(ia)
end

with ik = 4, the ouput is:

 bounds, full array                     -1           2
 bounds, full implicit section           1           4
 bounds, full explicit section           1           4
 derived type, ik=           4
 bounds, full array                     -1           2
 bounds, full implicit section          -1           2    <-- should not it be
1 4 as above?
 bounds, full explicit section           1           4

with ik = 8:

...
 derived type, ik=           8
 bounds, full array                      1           4    <--- should not it be
-1 2 as for ik = 4?
 bounds, full implicit section           1           4
 bounds, full explicit section           1           4


-- 
           Summary: Wrong lbound given to allocatable components
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: pault at gcc dot gnu dot org
        ReportedBy: pault at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38324


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

end of thread, other threads:[~2010-01-31 15:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-30  7:50 [Bug fortran/38324] New: Wrong lbound given to allocatable components pault at gcc dot gnu dot org
2008-12-01 13:55 ` [Bug fortran/38324] " dominiq at lps dot ens dot fr
2008-12-17 12:22 ` pault at gcc dot gnu dot org
2009-01-29 22:03 ` mikael at gcc dot gnu dot org
2010-01-30 18:22 ` pault at gcc dot gnu dot org
2010-01-31 12:05 ` pault at gcc dot gnu dot org
2010-01-31 14:57 ` pault at gcc dot gnu dot org
2010-01-31 15:00 ` 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).