This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Add verifier for leaked SSA names
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: Richard Biener <rguenther at suse dot de>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 5 Oct 2015 10:56:01 +0200
- Subject: Re: [PATCH] Add verifier for leaked SSA names
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot LSU dot 2 dot 11 dot 1510020935350 dot 6516 at zhemvz dot fhfr dot qr> <560EA19E dot 9070706 at redhat dot com>
On Fri, Oct 2, 2015 at 5:24 PM, Jeff Law <law@redhat.com> wrote:
> On 10/02/2015 01:37 AM, Richard Biener wrote:
>>
>>
>> The following patch doesn't pass bootstrap & regtest. It did at some
>> point though and its comment hints that fixing leaks after inlining
>> was too interesting a problem to solve ;)
>>
>> Thus patch is FYI.
>>
>> Richard.
>>
>> Index: tree-ssa.c
>> ===================================================================
>> --- tree-ssa.c (revision 228320)
>> +++ tree-ssa.c (working copy)
>> @@ -693,6 +693,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;
>> + }
>> +
>
> I was building the verification step into the ssa name manager. Essentially
> at the point where we flush from the pending to the free list, we should
> have a consistent state.
Yeah, though when SSA verifiers run the state should also be consistent
and we'd get to pinpoint the offending pass easier.
> Thus we ought to be able to walk the IL marking everything we can see,
> combine that with the contents of the freelist and the result ought to be
> every SSA_NAME ever created.
>
> Reality is somewhat different, of course.
>
> Yours takes a slightly different approach. Ultimately if we get the leaks
> plugged, we might even consider using both.
Sure. Note that the above is from simply walking all SSA names.
Richard.
> jeff
>
>
>