Commit 4e21ce56 authored by sebastian.buchwald1's avatar sebastian.buchwald1
Browse files

Fixed invalid use of out edges.

Since safely iterating over out edges caches the next edges, we cannot
recursively move Proj nodes along with their operands.
If the Proj node is the cached one this causes the out edges to suddenly iterate
over another block.

This fixes opt/fehler279.c and opt/fehler280.c.
parent ec0e3606
......@@ -290,9 +290,9 @@ ir_node *part_block_edges(ir_node *node)
/* move Phi nodes and constants to new_block */
foreach_out_edge_safe(old_block, edge) {
ir_node *blnode = get_edge_src_irn(edge);
if (!is_Phi(blnode) && !is_irn_start_block_placed(blnode))
continue;
move_node_edges(blnode, new_block);
ir_node *skip = skip_Proj(skip_Proj(blnode));
if (is_Phi(skip) || is_irn_start_block_placed(skip))
set_nodes_block(blnode, new_block);
}
if (old_block == get_irg_start_block(irg))
......
......@@ -745,8 +745,9 @@ ir_node *part_block_dw(ir_node *node)
/* move Phi nodes and constants to new_block */
foreach_out_edge_safe(old_block, edge) {
ir_node *blnode = get_edge_src_irn(edge);
if (is_Phi(blnode) || is_irn_start_block_placed(blnode))
move_node(blnode, new_block);
ir_node *skip = skip_Proj(skip_Proj(blnode));
if (is_Phi(skip) || is_irn_start_block_placed(skip))
set_nodes_block(blnode, new_block);
}
if (old_block == get_irg_start_block(irg))
set_irg_start_block(irg, new_block);
......
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