This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Properly release VOP of inlined call stmt
- From: Richard Biener <rguenther at suse dot de>
- To: Jeff Law <law at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Jakub Jelinek <jakub at redhat dot com>
- Date: Mon, 17 Feb 2014 16:20:03 +0100 (CET)
- Subject: Re: [PATCH] Properly release VOP of inlined call stmt
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot LSU dot 2 dot 11 dot 1402171440050 dot 1593 at zhemvz dot fhfr dot qr> <530224B2 dot 3050403 at redhat dot com>
On Mon, 17 Feb 2014, Jeff Law wrote:
> On 02/17/14 06:42, Richard Biener wrote:
> >
> > This makes us release the virtual SSA name associated with a call that
> > is inlined. This removes some garbage that is otherwise kept live
> > duing early opts (and thus reduces whole-program footprint).
> >
> > With this patch and the separately posted ipa-prop change I can
> > bootstrap & regtest with
> >
> > Index: gcc/tree-ssa.c
> > ===================================================================
> > --- gcc/tree-ssa.c (revision 207783)
> > +++ gcc/tree-ssa.c (working copy)
> > @@ -741,6 +741,16 @@ verify_def (basic_block bb, basic_block
> > goto err;
> > }
> >
> > + if (bb == NULL
> > + /* ??? Too many latent cases in the main opt pipeline. But it's
> > + worth to fix all cases before inlining as that reduces the
> > + amount of garbage kept live. */
> > + && !cfun->after_inlining)
> > + {
> > + error ("removed STMT failed to release SSA name");
> > + goto err;
> > + }
> > +
> > if (definition_block[SSA_NAME_VERSION (ssa_name)])
> > {
> > error ("SSA_NAME created in two different blocks %i and %i",
> >
> > applied.
> >
> > Bootstrapped and tested (with the above applied) on
> > x86_64-unknown-linux-gnu. Ok?
> >
> > Thanks,
> > Richard.
> >
> > 2014-02-17 Richard Biener <rguenther@suse.de>
> >
> > * tree-inline.c (expand_call_inline): Release the virtual
> > operand defined by the call we are about to inline.
> OK.
>
> ISTM that we ought to define stage4 as explicitly including this kind of stuff
> in addition to regression fixing. Not sure exactly what wording we'd want to
> use though.
>
> If you wanted to really go nuts, install a mark hook on for the RTL GGC
> routines that flags when a deleted insn is still reachable ;-) It's obviously
> not OK for the tree, but good for finding leaking deleted insns.
Yeah, though anything allocated post-IPA transform apply only exists for a
single function at a time while pre-IPA allocated stuff accumulates for
the whole compilation unit. So it's doubly worth spending on fixing
the pre-IPA stuff (even with unreleased SSA names the post-IPA world
is a big mess ;))
Richard.