Re: Free memory used by optimization/target options

2019-11-06 Thread Jeff Law
On 11/6/19 2:22 AM, Martin Liška wrote: > On 11/5/19 11:40 AM, Jan Hubicka wrote: >> +    print "  if (ptr->" name")"; >> +    print "    free (const_cast (ptr->" name"));"; > > If I'm correct, you can call free even for a NULL pointer. You can and I think we expunged all the NULL tests before cal

Re: Free memory used by optimization/target options

2019-11-06 Thread Martin Liška
On 11/5/19 11:40 AM, Jan Hubicka wrote: + print " if (ptr->" name")"; + print "free (const_cast (ptr->" name"));"; If I'm correct, you can call free even for a NULL pointer. Martin

Re: Free memory used by optimization/target options

2019-11-05 Thread Jan Hubicka
> On Tue, 5 Nov 2019, Jan Hubicka wrote: > > > Hi, > > this fixes memory leak for xstrduped strings in option summaries which may > > get ggc_freed by tree merging. > > > > Bootstrapped/regtested x86_64-linux, OK? > > OK. If those are ever reaped by regular GC the memory still leaks, no? > So w

Re: Free memory used by optimization/target options

2019-11-05 Thread Richard Biener
On Tue, 5 Nov 2019, Jan Hubicka wrote: > Hi, > this fixes memory leak for xstrduped strings in option summaries which may > get ggc_freed by tree merging. > > Bootstrapped/regtested x86_64-linux, OK? OK. If those are ever reaped by regular GC the memory still leaks, no? So wouldn't it be better