From ed00af335a4266f1b2573bb0463ec3c7ad39f125 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Fri, 26 Oct 2007 22:39:13 +0000 Subject: [PATCH] fixed handling of pn_Call_X_regular [r16372] --- ir/be/ia32/ia32_intrinsics.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/ir/be/ia32/ia32_intrinsics.c b/ir/be/ia32/ia32_intrinsics.c index bf18d32fe..88c02f27f 100644 --- a/ir/be/ia32/ia32_intrinsics.c +++ b/ir/be/ia32/ia32_intrinsics.c @@ -67,9 +67,10 @@ void ia32_handle_intrinsics(void) { * Replace a call be a tuple of l_res, h_res. */ static void resolve_call(ir_node *call, ir_node *l_res, ir_node *h_res, ir_graph *irg, ir_node *block) { - ir_node *res, *in[2]; + ir_node *jmp, *res, *in[2]; ir_node *bad = get_irg_bad(irg); ir_node *nomem = get_irg_no_mem(irg); + int old_cse; in[0] = l_res; in[1] = h_res; @@ -77,11 +78,19 @@ static void resolve_call(ir_node *call, ir_node *l_res, ir_node *h_res, ir_graph turn_into_tuple(call, pn_Call_max); set_Tuple_pred(call, pn_Call_M_regular, nomem); - /* Matze: the new_r_Jmp here sometimes CSEs and then bad things happen - * (in movgen.c from 186.crafty for example) I don't know why it is here - * and if this fix is correct... */ - /*set_Tuple_pred(call, pn_Call_X_regular, new_r_Jmp(irg, block));*/ - set_Tuple_pred(call, pn_Call_X_regular, bad); + /* + * Beware: + * We do not check here if this call really has exception and regular Proj's. + * new_r_Jmp might than be CSEd with the real exit jmp and then bad things happen + * (in movgen.c from 186.crafty for example). + * So be sure the newly created Jmp cannot CSE. + */ + old_cse = get_opt_cse(); + set_opt_cse(0); + jmp = new_r_Jmp(irg, block); + set_opt_cse(old_cse); + + set_Tuple_pred(call, pn_Call_X_regular, jmp); set_Tuple_pred(call, pn_Call_X_except, bad); set_Tuple_pred(call, pn_Call_T_result, res); set_Tuple_pred(call, pn_Call_M_except, nomem); -- 2.20.1