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 <[email protected]>
* tree-inline.c (expand_call_inline): Release the virtual
operand defined by the call we are about to inline.
Index: gcc/tree-inline.c
===================================================================
*** gcc/tree-inline.c (revision 207783)
--- gcc/tree-inline.c (working copy)
*************** expand_call_inline (basic_block bb, gimp
*** 4364,4369 ****
--- 4364,4372 ----
/* Unlink the calls virtual operands before replacing it. */
unlink_stmt_vdef (stmt);
+ if (gimple_vdef (stmt)
+ && TREE_CODE (gimple_vdef (stmt)) == SSA_NAME)
+ release_ssa_name (gimple_vdef (stmt));
/* If the inlined function returns a result that we care about,
substitute the GIMPLE_CALL with an assignment of the return