+ bsi_remove (&t->call_bsi, true);
+ release_defs (call);
+}
+
+/* Add phi nodes for the virtual operands defined in the function to the
+ header of the loop created by tail recursion elimination.
+
+ Originally, we used to add phi nodes only for call clobbered variables,
+ as the value of the non-call clobbered ones obviously cannot be used
+ or changed within the recursive call. However, the local variables
+ from multiple calls now share the same location, so the virtual ssa form
+ requires us to say that the location dies on further iterations of the loop,
+ which requires adding phi nodes.
+*/
+static void
+add_virtual_phis (void)
+{
+ referenced_var_iterator rvi;
+ tree var;
+
+ /* The problematic part is that there is no way how to know what
+ to put into phi nodes (there in fact does not have to be such
+ ssa name available). A solution would be to have an artificial
+ use/kill for all virtual operands in EXIT node. Unless we have
+ this, we cannot do much better than to rebuild the ssa form for
+ possibly affected virtual ssa names from scratch. */
+
+ FOR_EACH_REFERENCED_VAR (var, rvi)
+ {
+ if (!is_gimple_reg (var) && gimple_default_def (cfun, var) != NULL_TREE)
+ mark_sym_for_renaming (var);
+ }