This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/56921] [4.9 Regression] ICE in rtx_cost called by doloop_optimize_loops for PPC
- From: "rguenther at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 12 Apr 2013 08:45:46 +0000
- Subject: [Bug rtl-optimization/56921] [4.9 Regression] ICE in rtx_cost called by doloop_optimize_loops for PPC
- Auto-submitted: auto-generated
- References: <bug-56921-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56921
--- Comment #9 from rguenther at suse dot de <rguenther at suse dot de> 2013-04-12 08:45:46 UTC ---
On Fri, 12 Apr 2013, steven at gcc dot gnu.org wrote:
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56921
>
> --- Comment #8 from Steven Bosscher <steven at gcc dot gnu.org> 2013-04-12 08:36:04 UTC ---
> (In reply to comment #7)
> > niter_desc is not marked GTY(()) but is cached from struct loop aux field.
> > niter_desc uses heap memory but points to GC memory. Thus, caching of this
> > across passes is not safe.
> > I suppose passes are missing free_simple_loop_desc, loop-doloop.c calls
> > get_simple_loop_desc but never free_simple_loop_desc for example (which
> > then at least leaks the niter_desc memory).
>
> Another, IMHO better, solution would be to not use loop->aux but make
> a GC-safe vec indexed by loop->num. Maybe add checking in the loop
> verifier that no struct niter_desc is left pending if its parent loop
> is removed.
>
> That should make the loop passes GC safe.
>
> Then mark all "aux" fields as GC unsafe and document that every pass is
> responsible for cleaning up after itself.
Yes, definitely. I was bit once by this ->aux usage which is
not really obvious.
Richard.