Commit 7c461c2c authored by Christoph Mallon's avatar Christoph Mallon
Browse files

Do not build an unnecessary Phi when inlining a function with a single return.

This accidently turns opt/compilerhang3.c from an execute failure back into a compile failure by not creating a volatile CopyB anymore.
parent 006764a9
......@@ -516,9 +516,10 @@ static bool inline_method(ir_node *const call, ir_graph *called_graph)
n_ret++;
}
}
ir_node *const phi = n_ret > 0
? new_r_Phi(post_bl, n_ret, cf_pred, res_mode)
: new_r_Bad(irg, res_mode);
ir_node *const phi =
n_ret == 0 ? new_r_Bad(irg, res_mode) :
n_ret == 1 ? cf_pred[0] :
new_r_Phi(post_bl, n_ret, cf_pred, res_mode);
/* Conserve Phi-list for further inlining -- but might be
* optimized */
if (get_nodes_block(phi) == post_bl) {
......
Supports Markdown
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