Re: [Patch, Fortran] Plug memory leaks; fix tree-check ICE for PR

2012-08-27 Thread Mikael Morin
On 27/08/2012 17:11, Tobias Burnus wrote: >> could you add comments >> in gfortran.h telling which pointers account for reference counting? >> As far as I remember for symbols, there are: >>gfc_symtree::n::sym; >>gfc_namespace::proc_name; > > Well, I have still not gained a full overview a

Re: [Patch, Fortran] Plug memory leaks; fix tree-check ICE for PR

2012-08-27 Thread Tobias Burnus
On 08/27/2012 03:19 PM, Mikael Morin wrote: as you seem to be very much into memory issues, Well, it started as middle-end project by Steven Bosscher and others which looked at memory issues due to http://gcc.gnu.org/PR54146 (a program using attribute((flatten)), which essentially causes the

Re: [Patch, Fortran] Plug memory leaks; fix tree-check ICE for PR

2012-08-27 Thread Mikael Morin
On 27/08/2012 14:14, Tobias Burnus wrote: > On 08/26/2012 08:12 PM, Tobias Burnus wrote: >> This patch fixes one ICE and several memory leaks. But there are more. >> > > I have now committed the patch with the following additional patch > * module.c (mio_symbol): Don't increase sym->refs f

Re: [Patch, Fortran] Plug memory leaks; fix tree-check ICE for PR

2012-08-27 Thread Tobias Burnus
On 08/26/2012 08:12 PM, Tobias Burnus wrote: This patch fixes one ICE and several memory leaks. But there are more. I have now committed the patch with the following additional patch * module.c (mio_symbol): Don't increase sym->refs for its use in sym->formal_ns->proc_name. Th

Re: [Patch, Fortran] Plug memory leaks; fix tree-check ICE for PR

2012-08-26 Thread Tobias Burnus
Tobias Burnus wrote: PS: I wonder why gfortran.dg/interface_3.f90 passed before, given that "proc_locus" wasn't set before. I also wonder why my patch causes the test case to segfault. Well, at least that bug is now also fixed. Answer: Because I am too strupid to read the patch after spendin

[Patch, Fortran] Plug memory leaks; fix tree-check ICE for PR

2012-08-26 Thread Tobias Burnus
This patch fixes one ICE and several memory leaks. But there are more. * The patch with symbol.c and resolve.c fixes the following issue: gfortran leaks memory for: REAL FUNCTION GGL(ds) GGL = 16806.D0 END The problem is the following code in resolve_sym