aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/optimize.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2000-06-12 19:26:43 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2000-06-12 19:26:43 +0000
commit071f9809f9eb3c218470691a8f04776af73c7988 (patch)
tree07c03bc9dba5293c1ca256f94206facbe898ae02 /gcc/cp/optimize.c
parentf6f8291af02282edca4357f07a12900b2666e4a5 (diff)
downloadgcc-071f9809f9eb3c218470691a8f04776af73c7988.zip
gcc-071f9809f9eb3c218470691a8f04776af73c7988.tar.gz
gcc-071f9809f9eb3c218470691a8f04776af73c7988.tar.bz2
optimize.c (expand_call_inline): Don't recurse into the code used to initialize the parameters more than once.
* optimize.c (expand_call_inline): Don't recurse into the code used to initialize the parameters more than once. From-SVN: r34501
Diffstat (limited to 'gcc/cp/optimize.c')
-rw-r--r--gcc/cp/optimize.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c
index fa8d9e8..b803627 100644
--- a/gcc/cp/optimize.c
+++ b/gcc/cp/optimize.c
@@ -612,6 +612,7 @@ expand_call_inline (tp, walk_subtrees, data)
tree scope_stmt;
tree use_stmt;
tree arg_inits;
+ tree *inlined_body;
splay_tree st;
/* See what we've got. */
@@ -724,8 +725,10 @@ expand_call_inline (tp, walk_subtrees, data)
/* After we've initialized the parameters, we insert the body of the
function itself. */
- STMT_EXPR_STMT (expr)
- = chainon (STMT_EXPR_STMT (expr), copy_body (id));
+ inlined_body = &STMT_EXPR_STMT (expr);
+ while (*inlined_body)
+ inlined_body = &TREE_CHAIN (*inlined_body);
+ *inlined_body = copy_body (id);
/* Close the block for the parameters. */
scope_stmt = build_min_nt (SCOPE_STMT, DECL_INITIAL (fn));
@@ -771,7 +774,7 @@ expand_call_inline (tp, walk_subtrees, data)
TREE_USED (*tp) = 1;
/* Recurse into the body of the just inlined function. */
- expand_calls_inline (tp, id);
+ expand_calls_inline (inlined_body, id);
VARRAY_POP (id->fns);
/* Don't walk into subtrees. We've already handled them above. */