From 03ba2bc072b9b94a6ea44be3fb6c1e0ff476f17b Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=B6tz=20Lindenmaier?= Date: Tue, 12 Mar 2002 11:37:29 +0000 Subject: [PATCH] Bugfix in inlining: problems in combination with cse. [r326] --- ir/ir/irgopt.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ir/ir/irgopt.c b/ir/ir/irgopt.c index d0595cc0d..c86fd2367 100644 --- a/ir/ir/irgopt.c +++ b/ir/ir/irgopt.c @@ -410,13 +410,15 @@ void inline_method(ir_node *call, ir_graph *called_graph) { ir_node **cf_pred; ir_node *ret, *phi; ir_node *cf_op, *bl; - int arity, n_ret, n_exc, n_res, i, j; + int arity, n_ret, n_exc, n_res, i, j, rem_opt; type *called_frame, *caller_frame; if (!get_opt_inline()) return; /* Handle graph state */ assert(get_irg_phase_state(current_ir_graph) != phase_building); + assert(get_irg_pinned(current_ir_graph) == pinned); + assert(get_irg_pinned(called_graph) == pinned); if (get_irg_outs_state(current_ir_graph) == outs_consistent) set_irg_outs_inconsistent(current_ir_graph); @@ -426,6 +428,10 @@ void inline_method(ir_node *call, ir_graph *called_graph) { assert(get_type_tpop(get_Call_type(call)) == type_method); if (called_graph == current_ir_graph) return; + /** Turn off cse, this can cause problems when allocating new nodes. **/ + rem_opt = get_opt_cse(); + set_opt_cse(0); + /** Part the Call node into two nodes. Pre_call collects the parameters of the procedure and later replaces the Start node of the called graph. Post_call is the old Call node and collects the results of the called @@ -652,6 +658,9 @@ void inline_method(ir_node *call, ir_graph *called_graph) { set_irn_in(end_bl, arity, cf_pred); free(cf_pred); } + + /** Turn cse back on. **/ + set_opt_cse(rem_opt); } /********************************************************************/ -- 2.20.1