summaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-09-15 15:01:57 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-09-15 15:01:57 +0000
commit86a58d7f49baf072530d96dd6b48a0b4f6bca911 (patch)
tree28780414aa6eae96bfb134b18a3bee72b9b7ff88 /gcc/tree-inline.c
parentb828b315689edb38104fd4e0d938b8736f871194 (diff)
downloadgcc-86a58d7f49baf072530d96dd6b48a0b4f6bca911.tar.gz
2008-09-15 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r140370 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@140372 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r--gcc/tree-inline.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 114cd4718e3..ebc8b32916b 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -1029,6 +1029,7 @@ remap_gimple_stmt (gimple stmt, copy_body_data *id)
gimple copy = NULL;
struct walk_stmt_info wi;
tree new_block;
+ bool skip_first = false;
/* Begin by recognizing trees that we'll completely rewrite for the
inlining context. Our output for these trees is completely
@@ -1050,7 +1051,11 @@ remap_gimple_stmt (gimple stmt, copy_body_data *id)
already been set (e.g. a recent "foo (&result_decl, ...)");
just toss the entire GIMPLE_RETURN. */
if (retval && TREE_CODE (retval) != RESULT_DECL)
- copy = gimple_build_assign (id->retvar, retval);
+ {
+ copy = gimple_build_assign (id->retvar, retval);
+ /* id->retvar is already substituted. Skip it on later remapping. */
+ skip_first = true;
+ }
else
return gimple_build_nop ();
}
@@ -1216,7 +1221,10 @@ remap_gimple_stmt (gimple stmt, copy_body_data *id)
/* Remap all the operands in COPY. */
memset (&wi, 0, sizeof (wi));
wi.info = id;
- walk_gimple_op (copy, remap_gimple_op_r, &wi);
+ if (skip_first)
+ walk_tree (gimple_op_ptr (copy, 1), remap_gimple_op_r, &wi, NULL);
+ else
+ walk_gimple_op (copy, remap_gimple_op_r, &wi);
/* We have to handle EH region remapping of GIMPLE_RESX specially because
the region number is not an operand. */