This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, fortran] PR32665 - allocatable array on lhs deleted while still in use on rhs


Tobias,

OK. Thanks for the fix.

Many thanks to you.




Side remark: The generated executable leaks memory:

Oh, fiddlesticks!



96 bytes in 1 blocks are definitely lost in loss record 1 of 2 at 0x4C22D06: malloc (in /usr/lib64/valgrind/amd64-linux/vgpreload_memcheck.so) by 0x40122B: MAIN__ (alloc_comp_assign_2.f90:11) by 0x401EEB: main (fmain.c:22)

 96 bytes in 1 blocks are definitely lost in loss record 2 of 2
    at 0x4C22D06: malloc (in
/usr/lib64/valgrind/amd64-linux/vgpreload_memcheck.so)
    by 0x400BCA: MAIN__ (alloc_comp_assign_2.f90:10)
    by 0x401EEB: main (fmain.c:22)


for this stripped down test case:


  type :: a
    integer, allocatable :: i(:)
  end type a
  type :: b
    type (a), allocatable :: at(:)
  end type b
  type(a) :: x(2)
  type(b) :: y(2)
  integer i
  y(1) = b ((/x(1),x(2)/))
  y(2) = b ((/x(2),x(1)/))
  forall (i=1:2) y(i) = b ((/x(i)/))
end


I'll see if I can figure out how, when and where. I cannot commit the patch until the weekend, so I'll see what I can see.

Cheers

Paul


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]