Commit 75bdba69 authored by Matthias Braun's avatar Matthias Braun
Browse files

fixed the fix of the fix (that was fix)

[r14462]
parent e15091dc
......@@ -1063,18 +1063,18 @@ static unsigned optimize_phi(ir_node *phi, walk_env_t *wenv)
first because we otherwise may loose a store when exchanging its
memory Proj.
*/
for (i = 0; i < n; ++i)
for (i = n - 1; i >= 0; --i) {
ir_node *store;
projMs[i] = get_Phi_pred(phi, i);
assert(is_Proj(projMs[i]));
/* first step: collect all inputs and kill the node */
for (i = n - 1; i >= 0; --i) {
ir_node *store = get_Proj_pred(projMs[i]);
info = get_irn_link(store);
store = get_Proj_pred(projMs[i]);
info = get_irn_link(store);
inM[i] = get_Store_mem(store);
inD[i] = get_Store_value(store);
idx[i] = info->exc_idx;
kill_node(store);
}
block = get_nodes_block(phi);
......@@ -1084,11 +1084,15 @@ static unsigned optimize_phi(ir_node *phi, walk_env_t *wenv)
/* third step: create a new data Phi */
phiD = new_rd_Phi(get_irn_dbg_info(phi), current_ir_graph, block, n, inD, mode);
/* rewire memory */
/* rewire memory and kill the node */
for (i = n - 1; i >= 0; --i) {
ir_node *proj = projMs[i];
ir_node *proj = projMs[i];
exchange(proj, inM[i]);
if(is_Proj(proj)) {
ir_node *store = get_Proj_pred(proj);
exchange(proj, inM[i]);
kill_node(store);
}
}
/* fourth step: create the Store */
......
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