Check that unlinked uses do not contain ssa-names when renaming.

Richard Guenther richard.guenther@gmail.com
Mon Oct 8 09:24:00 GMT 2012


On Sun, Oct 7, 2012 at 12:44 PM, Tom de Vries <Tom_deVries@mentor.com> wrote:
> Richard,
>
> attached patch checks that unlinked uses do not contain ssa-names when renaming.
>
> This assert triggers when compiling (without the fix) the PR54735 example.
>
> AFAIU, it was due to chance that we caught the PR54735 bug by hitting the
> verification failure, because the new vdef introduced by renaming happened to be
> the same name as the ssa name referenced in the invalid unlinked use (in terms
> of maybe_replace_use: rdef == use).
>
> The assert from this patch catches all cases that an unlinked use contains an
> ssa-name.
>
> Bootstrapped and reg-tested on x86_64 (Ada inclusive).
>
> OK for trunk?

I don't think that is exactly what we should assert here ... (I thought about
adding checking myself ...).  What we'd want to assert is that before
any new DEF is registered (which may re-allocate an SSA name) that
no uses with SSA_NAME_IN_FREELIST appear.  Thus, a light verification
pass would be necessary at the beginning of update_ssa
(which I queued onto my TODO list ...).  We'd want that anyway to for
example catch the case where a non-virtual operand is partially renamed.

Thanks,
Richard.

> Thanks,
> - Tom
>
> 2012-10-07  Tom de Vries  <tom@codesourcery.com>
>
>         * tree-into-ssa.c (maybe_replace_use): Add assert.



More information about the Gcc-patches mailing list