This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/64986] class_to_type_4.f90: valgrind error: Invalid read/write of size 8
- From: "dominiq at lps dot ens.fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 16 Feb 2015 15:36:27 +0000
- Subject: [Bug fortran/64986] class_to_type_4.f90: valgrind error: Invalid read/write of size 8
- Auto-submitted: auto-generated
- References: <bug-64986-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64986
--- Comment #4 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Reduced test
program test
implicit none
type t
integer :: ii
end type t
type, extends(t) :: u
real :: rr
end type u
type, extends(t) :: v
real, allocatable :: rr(:)
end type v
type, extends(v) :: w
real, allocatable :: rrr(:)
end type w
type(v) :: b(3)
b = func7() ! scalar daughter type to array - alloc comps in parent type
contains
function func7() result(res)
class(v), allocatable :: res
allocate (res, source = w(3,[10.0,20.0],[100,200]))
end function func7
end program test
There is no problem with the original test once the following lines are
commented
b = func7() ! scalar daughter type to array - alloc comps in parent type
if (any (b(2)%rr .ne. [10.0,20.0])) call abort