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


> X-Original-To: geoffk@foam.wonderslug.com
> Date: Sat, 17 Jan 2004 10:56:06 +0100
> From: Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
> Cc: gcc-patches@gcc.gnu.org
> Content-Disposition: inline
> X-OriginalArrivalTime: 17 Jan 2004 10:24:16.0484 (UTC) FILETIME=[0F5BE240:01C3DCE4]
> 
> 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?  A normal
bootstrap doesn't exercise GC very much.

-- 
- Geoffrey Keating <geoffk@geoffk.org>


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