------- Comment #13 from dominiq at lps dot ens dot fr  2008-02-12 10:54 -------
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


-- 


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

Reply via email to