[Bug fortran/47517] [F03] Reallocate on assignment: Segfault
pault at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Feb 7 06:10:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47517
Paul Thomas <pault at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011.02.07 05:32:21
Ever Confirmed|0 |1
--- Comment #1 from Paul Thomas <pault at gcc dot gnu.org> 2011-02-07 05:32:21 UTC ---
(In reply to comment #0)
This somewhat reduced version of James testcase retains the segfault in bar.
Now to understand what happens in foo!
Confirmed
Paul
>program allocate_assign
implicit none
type label
integer, allocatable :: parts(:)
end type label
type table
type(label), allocatable :: headers(:)
end type table
integer, parameter :: ik8 = selected_int_kind(18)
type(table) x1(1)
type(table) t1
type(table), allocatable :: x(:)
integer k
integer(ik8) s
t1 = table([label([1])])
x1 = [t1]
s = 0
do k = 1, 2
write(*,*) "1> ", k,s
call foo
write(*,*) "2> ",k,s, size (x)
call bar
end do
write(*,*) s
contains
subroutine foo
x = x1
end subroutine
subroutine bar
s = s+x(2)%headers(2)%parts(2)
end subroutine
end program allocate_assign
More information about the Gcc-bugs
mailing list