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? Thanks, - Tom 2012-10-07 Tom de Vries <t...@codesourcery.com> * tree-into-ssa.c (maybe_replace_use): Add assert.
Index: gcc/tree-into-ssa.c =================================================================== --- gcc/tree-into-ssa.c (revision 192023) +++ gcc/tree-into-ssa.c (working copy) @@ -1773,6 +1773,9 @@ rdef = get_reaching_def (sym); else if (is_old_name (use)) rdef = get_reaching_def (use); + + if (use_p->prev == NULL && use_p->next == NULL) + gcc_assert (TREE_CODE (use) != SSA_NAME); if (rdef && rdef != use) SET_USE (use_p, rdef);