+/* Inserting Single Entry Multiple Exit region in SSA form into code in SSA
+ form is quite easy, since dominator relationship for old basic blocks does
+ not change.
+
+ There is however exception where inlining might change dominator relation
+ across EH edges from basic block within inlined functions destinating
+ to landing pads in function we inline into.
+
+ The function fills in PHI_RESULTs of such PHI nodes if they refer
+ to gimple regs. Otherwise, the function mark PHI_RESULT of such
+ PHI nodes for renaming. For non-gimple regs, renaming is safe: the
+ EH edges are abnormal and SSA_NAME_OCCURS_IN_ABNORMAL_PHI must be
+ set, and this means that there will be no overlapping live ranges
+ for the underlying symbol.
+
+ This might change in future if we allow redirecting of EH edges and
+ we might want to change way build CFG pre-inlining to include
+ all the possible edges then. */
+static void
+update_ssa_across_abnormal_edges (basic_block bb, basic_block ret_bb,
+ bool can_throw, bool nonlocal_goto)
+{
+ edge e;
+ edge_iterator ei;
+
+ FOR_EACH_EDGE (e, ei, bb->succs)
+ if (!e->dest->aux
+ || ((basic_block)e->dest->aux)->index == ENTRY_BLOCK)
+ {
+ tree phi;
+
+ gcc_assert (e->flags & EDGE_ABNORMAL);
+ if (!nonlocal_goto)
+ gcc_assert (e->flags & EDGE_EH);
+ if (!can_throw)
+ gcc_assert (!(e->flags & EDGE_EH));
+ for (phi = phi_nodes (e->dest); phi; phi = PHI_CHAIN (phi))
+ {
+ edge re;
+
+ /* There shouldn't be any PHI nodes in the ENTRY_BLOCK. */
+ gcc_assert (!e->dest->aux);
+
+ gcc_assert (SSA_NAME_OCCURS_IN_ABNORMAL_PHI
+ (PHI_RESULT (phi)));
+
+ if (!is_gimple_reg (PHI_RESULT (phi)))
+ {
+ mark_sym_for_renaming
+ (SSA_NAME_VAR (PHI_RESULT (phi)));
+ continue;
+ }
+
+ re = find_edge (ret_bb, e->dest);
+ if (!re)
+ continue;
+ gcc_assert ((re->flags & (EDGE_EH | EDGE_ABNORMAL))
+ == (e->flags & (EDGE_EH | EDGE_ABNORMAL)));
+
+ SET_USE (PHI_ARG_DEF_PTR_FROM_EDGE (phi, e),
+ USE_FROM_PTR (PHI_ARG_DEF_PTR_FROM_EDGE (phi, re)));
+ }
+ }
+}
+