This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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] for optimization/12440


Hello,

> > > > loop optimizer keeps allocating trash due to expression simplification,
> > > > which leads to huge amount of memory consumed in case there is a lot of
> > > > loops in the function.  This patch fixes it by running garbage collector
> > > > after each loop is optimized.
> > > > 
> > > > Bootstrapped & regtested on i686.
> > > 
> > > Is it really safe to call ggc_collect here?  Look at all the stuff
> > > that's freed after this:
> > > 
> > >   end_alias_analysis ();
> > > 
> > >   /* Clean up.  */
> > >   for (i = 0; i < (int) loops->num; i++)
> > >     free (loops_info[i].mems);
> > > 
> > >   free (uid_luid);
> > >   free (uid_loop);
> > >   free (loops_info);
> > >   free (loops->array);
> > > 
> > > Are you sure none of that will contain the only reference to some GCed
> > > item (like a rtx)?
> > 
> > not at all.  It however passes the testing without any problems, and I
> > assume that if there were such a problem, it would trigger.  It might
> > be safer to call ggc_push_context before the loop.
> 
> Did you bootstrap with --enable-checking=tree,misc,gc,gcac?

no. I have tried it now, but the clean branch does not compile with
these flags in the moment.

Zdenek


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