Commit 6266879a authored by yb9976's avatar yb9976
Browse files

ircons: Handle Phis after we know the number of block inputs.

Otherwise, we may create a Phi without operands and later
add a Bad input to the Block.
parent 16aa1b98
......@@ -250,17 +250,6 @@ void mature_immBlock(ir_node *block)
if (get_Block_matured(block))
return;
/* Traverse a chain of Phi nodes attached to this block and mature these,
* too. */
for (ir_node *phi = block->attr.block.phis; phi != NULL;) {
ir_node *const next = phi->attr.phi.next;
int const pos = phi->attr.phi.u.pos;
ir_node *const new_value = set_phi_arguments(phi, pos);
if (block->attr.block.graph_arr[pos] == phi)
block->attr.block.graph_arr[pos] = new_value;
phi = next;
}
set_Block_matured(block, 1);
/* Create final in-array for the block. */
......@@ -286,6 +275,17 @@ void mature_immBlock(ir_node *block)
block->attr.block.dynamic_ins = false;
}
/* Traverse a chain of Phi nodes attached to this block and mature these,
* too. */
for (ir_node *phi = block->attr.block.phis; phi != NULL;) {
ir_node *const next = phi->attr.phi.next;
int const pos = phi->attr.phi.u.pos;
ir_node *const new_value = set_phi_arguments(phi, pos);
if (block->attr.block.graph_arr[pos] == phi)
block->attr.block.graph_arr[pos] = new_value;
phi = next;
}
/* Now, as the block is a finished Firm node, we can optimize it.
* Since other nodes have been allocated since the block was created we can
* not free the node on the obstack. Therefore we have to call
......
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