When IPA-SRA removes an SSA_NAME from a LHS of a call statement
because it is not necessary, it does not release it. This patch fixes
that.
gcc/ChangeLog:
2021-04-08 Martin Jambor <mjambor@suse.cz>
PR ipa/99951
* ipa-param-manipulation.c (ipa_param_adjustments::modify_call):
If removing a call statement LHS SSA name, release it.
gcall *new_stmt = gimple_build_call_vec (callee_decl, vargs);
+ tree ssa_to_remove = NULL;
if (tree lhs = gimple_call_lhs (stmt))
{
if (!m_skip_return)
}
update_stmt (using_stmt);
}
+ ssa_to_remove = lhs;
}
}
fprintf (dump_file, "\n");
}
gsi_replace (&gsi, new_stmt, true);
+ if (ssa_to_remove)
+ release_ssa_name (ssa_to_remove);
if (update_references)
do
{