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

--- Comment #6 from janus at gcc dot gnu.org 2011-05-15 22:05:00 UTC ---
The patch in comment #5 regtests cleanly.


But apparently there is also a problem with MOVE_ALLOC and allocatable arrays:


program testmv3
  type bar
    integer, allocatable  :: ia(:), ja(:)
  end type

  type(bar), allocatable :: sm(:),sm2(:)

  allocate(sm(1))
  allocate(sm(1)%ia(10),sm(1)%ja(10))

  call move_alloc(sm2,sm)

end program testmv3


valgrind shows that the allocatable components are not being freed:


==21249== 40 bytes in 1 blocks are definitely lost in loss record 1 of 2
==21249==    at 0x4C2683D: malloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==21249==    by 0x400B8F: MAIN__ (arr.f90:10)
==21249==    by 0x400FE6: main (arr.f90:14)
==21249== 
==21249== 40 bytes in 1 blocks are definitely lost in loss record 2 of 2
==21249==    at 0x4C2683D: malloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==21249==    by 0x400CF4: MAIN__ (arr.f90:10)
==21249==    by 0x400FE6: main (arr.f90:14)

Reply via email to