+ *pointer_map_insert (id->decl_map, value) = value;
+}
+
+/* Construct new SSA name for old NAME. ID is the inline context. */
+
+static tree
+remap_ssa_name (tree name, copy_body_data *id)
+{
+ tree new;
+ tree *n;
+
+ gcc_assert (TREE_CODE (name) == SSA_NAME);
+
+ n = (tree *) pointer_map_contains (id->decl_map, name);
+ if (n)
+ return *n;
+
+ /* Do not set DEF_STMT yet as statement is not copied yet. We do that
+ in copy_bb. */
+ new = remap_decl (SSA_NAME_VAR (name), id);
+ /* We might've substituted constant or another SSA_NAME for
+ the variable.
+
+ Replace the SSA name representing RESULT_DECL by variable during
+ inlining: this saves us from need to introduce PHI node in a case
+ return value is just partly initialized. */
+ if ((TREE_CODE (new) == VAR_DECL || TREE_CODE (new) == PARM_DECL)
+ && (TREE_CODE (SSA_NAME_VAR (name)) != RESULT_DECL
+ || !id->transform_return_to_modify))
+ {
+ new = make_ssa_name (new, NULL);
+ insert_decl_map (id, name, new);
+ SSA_NAME_OCCURS_IN_ABNORMAL_PHI (new)
+ = SSA_NAME_OCCURS_IN_ABNORMAL_PHI (name);
+ TREE_TYPE (new) = TREE_TYPE (SSA_NAME_VAR (new));
+ if (IS_EMPTY_STMT (SSA_NAME_DEF_STMT (name)))
+ {
+ /* By inlining function having uninitialized variable, we might
+ extend the lifetime (variable might get reused). This cause
+ ICE in the case we end up extending lifetime of SSA name across
+ abnormal edge, but also increase register pressure.
+
+ We simply initialize all uninitialized vars by 0 except for case
+ we are inlining to very first BB. We can avoid this for all
+ BBs that are not withing strongly connected regions of the CFG,
+ but this is bit expensive to test.
+ */
+ if (id->entry_bb && is_gimple_reg (SSA_NAME_VAR (name))
+ && TREE_CODE (SSA_NAME_VAR (name)) != PARM_DECL
+ && (id->entry_bb != EDGE_SUCC (ENTRY_BLOCK_PTR, 0)->dest
+ || EDGE_COUNT (id->entry_bb->preds) != 1))
+ {
+ block_stmt_iterator bsi = bsi_last (id->entry_bb);
+ tree init_stmt
+ = build_gimple_modify_stmt (new,
+ fold_convert (TREE_TYPE (new),
+ integer_zero_node));
+ bsi_insert_after (&bsi, init_stmt, BSI_NEW_STMT);
+ SSA_NAME_DEF_STMT (new) = init_stmt;
+ SSA_NAME_IS_DEFAULT_DEF (new) = 0;
+ }
+ else
+ {
+ SSA_NAME_DEF_STMT (new) = build_empty_stmt ();
+ if (gimple_default_def (id->src_cfun, SSA_NAME_VAR (name)) == name)
+ set_default_def (SSA_NAME_VAR (new), new);
+ }
+ }
+ }
+ else
+ insert_decl_map (id, name, new);
+ return new;