diff options
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r-- | gcc/tree-inline.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 015a907..19f202e 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -2456,8 +2456,9 @@ initialize_cfun (tree new_fndecl, tree callee_fndecl, gcov_type count) if (src_cfun->gimple_df) { init_tree_ssa (cfun); - cfun->gimple_df->in_ssa_p = true; - init_ssa_operands (cfun); + cfun->gimple_df->in_ssa_p = src_cfun->gimple_df->in_ssa_p; + if (cfun->gimple_df->in_ssa_p) + init_ssa_operands (cfun); } } @@ -5119,10 +5120,21 @@ replace_locals_op (tree *tp, int *walk_subtrees, void *data) tree *n; tree expr = *tp; + /* For recursive invocations this is no longer the LHS itself. */ + bool is_lhs = wi->is_lhs; + wi->is_lhs = false; + + if (TREE_CODE (expr) == SSA_NAME) + { + *tp = remap_ssa_name (*tp, id); + *walk_subtrees = 0; + if (is_lhs) + SSA_NAME_DEF_STMT (*tp) = gsi_stmt (wi->gsi); + } /* Only a local declaration (variable or label). */ - if ((TREE_CODE (expr) == VAR_DECL - && !TREE_STATIC (expr)) - || TREE_CODE (expr) == LABEL_DECL) + else if ((TREE_CODE (expr) == VAR_DECL + && !TREE_STATIC (expr)) + || TREE_CODE (expr) == LABEL_DECL) { /* Lookup the declaration. */ n = st->get (expr); @@ -5262,6 +5274,7 @@ copy_gimple_seq_and_replace_locals (gimple_seq seq) memset (&id, 0, sizeof (id)); id.src_fn = current_function_decl; id.dst_fn = current_function_decl; + id.src_cfun = cfun; id.decl_map = new hash_map<tree, tree>; id.debug_map = NULL; |