Commit 13f79f00 authored by Matthias Braun's avatar Matthias Braun
Browse files

do not set Jmp/Bad predecessors when turning non-throwing nodes into tuples

parent a3756e0a
......@@ -3406,13 +3406,18 @@ make_tuple:;
/* skip a potential Pin */
mem = skip_Pin(mem);
ir_node *const in[] = {
ir_node *in[pn_Div_max+1] = {
[pn_Div_M] = mem,
[pn_Div_res] = value,
[pn_Div_X_regular] = new_r_Jmp(blk),
[pn_Div_X_except] = new_r_Bad(irg, mode_X),
};
turn_into_tuple(n, ARRAY_SIZE(in), in);
int n_in = 2;
assert(pn_Div_M == 0 && pn_Div_res == 1);
if (ir_throws_exception(n)) {
in[pn_Div_X_regular] = new_r_Jmp(blk);
in[pn_Div_X_except] = new_r_Bad(irg, mode_X);
n_in = 4;
}
turn_into_tuple(n, n_in, in);
}
return n;
}
......@@ -3491,13 +3496,18 @@ make_tuple:;
/* skip a potential Pin */
mem = skip_Pin(mem);
ir_node *const in[] = {
ir_node *in[pn_Mod_max+1] = {
[pn_Mod_M] = mem,
[pn_Mod_res] = value,
[pn_Mod_X_regular] = new_r_Jmp(blk),
[pn_Mod_X_except] = new_r_Bad(irg, mode_X),
[pn_Mod_res] = value
};
turn_into_tuple(n, ARRAY_SIZE(in), in);
int n_in = 2;
assert(pn_Mod_M == 0 && pn_Mod_res == 1);
if (ir_throws_exception(n)) {
in[pn_Mod_X_regular] = new_r_Jmp(blk);
in[pn_Mod_X_except] = new_r_Bad(irg, mode_X);
n_in = 4;
}
turn_into_tuple(n, n_in, in);
}
return n;
}
......
......@@ -564,8 +564,6 @@ static bool inline_method(ir_node *const call, ir_graph *called_graph)
} else {
call_res = new_r_Bad(irg, mode_T);
}
/* handle the regular call */
ir_node *const call_x_reg = new_r_Jmp(post_bl);
/* Finally the exception control flow.
We have two possible situations:
......@@ -626,13 +624,18 @@ static bool inline_method(ir_node *const call, ir_graph *called_graph)
free(res_pred);
free(cf_pred);
ir_node *const call_in[] = {
ir_node *call_in[pn_Call_max+1] = {
[pn_Call_M] = call_mem,
[pn_Call_T_result] = call_res,
[pn_Call_X_regular] = call_x_reg,
[pn_Call_X_except] = call_x_exc,
};
turn_into_tuple(call, ARRAY_SIZE(call_in), call_in);
int n_in = 2;
assert(pn_Call_M == 0 && pn_Call_T_result == 1);
if (ir_throws_exception(call)) {
call_in[pn_Call_X_regular] = new_r_Jmp(post_bl);
call_in[pn_Call_X_except] = call_x_exc;
n_in = 4;
}
turn_into_tuple(call, n_in, call_in);
/* -- Turn CSE back on. -- */
set_optimize(rem_opt);
......
......@@ -262,9 +262,6 @@ static void do_opt_tail_rec(ir_graph *irg, tr_env *env)
ir_node *const call = skip_Proj(get_Return_mem(p));
ir_node *const mem = get_Call_mem(call);
/* create a new jump */
ir_node *jmp = new_r_Jmp(block);
for (size_t i = 0; i < env->n_ress; ++i) {
ir_mode *mode = modes[i];
if (env->variants[i] != TR_DIRECT) {
......@@ -276,13 +273,18 @@ static void do_opt_tail_rec(ir_graph *irg, tr_env *env)
/* create a new tuple for the return values */
ir_node *tuple = new_r_Tuple(block, env->n_ress, in);
ir_node *const in[] = {
ir_node *in[pn_Call_max+1] = {
[pn_Call_M] = mem,
[pn_Call_T_result] = tuple,
[pn_Call_X_regular] = jmp,
[pn_Call_X_except] = new_r_Bad(irg, mode_X),
[pn_Call_T_result] = tuple
};
turn_into_tuple(call, ARRAY_SIZE(in), in);
int n_in = 2;
assert(pn_Call_M == 0 && pn_Call_T_result == 1);
if (ir_throws_exception(call)) {
in[pn_Call_X_regular] = new_r_Jmp(block);
in[pn_Call_X_except] = new_r_Bad(irg, mode_X);
n_in = 4;
}
turn_into_tuple(call, n_in, in);
for (size_t i = 0; i < env->n_ress; ++i) {
ir_node *res = get_Return_res(p, i);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment