Commit 539d04f4 authored by Christoph Mallon's avatar Christoph Mallon
Browse files

Correctly handle the case that unreachble blocks are not necessarily replaced...

Correctly handle the case that unreachble blocks are not necessarily replaced before the nodes they contain.
parent bcf7240e
......@@ -602,12 +602,13 @@ static void apply_result(ir_node* const irn, void* ctx)
{
environment_t* env = (environment_t*)ctx;
ir_node* block;
bitinfo* block_b;
bitinfo* b;
ir_tarval* z;
ir_tarval* o;
if (is_Block(irn)) {
bitinfo* const block_b = get_bitinfo(irn);
block_b = get_bitinfo(irn);
/* Trivially unreachable blocks have no info. */
if (block_b == NULL || block_b->z == get_tarval_b_false()) {
exchange(irn, get_irg_bad(get_Block_irg(irn)));
......@@ -616,10 +617,12 @@ static void apply_result(ir_node* const irn, void* ctx)
return;
}
/* Unreachable blocks are replaced before the nodes in them. */
block = get_nodes_block(irn);
if (is_Bad(block)) {
exchange(irn, block);
block = get_nodes_block(irn);
block_b = get_bitinfo(block);
/* Trivially unreachable blocks have no info. */
if (block_b == NULL || block_b->z == get_tarval_b_false()) {
/* Unreachable blocks might be replaced before the nodes in them. */
exchange(irn, is_Bad(block) ? block : get_irg_bad(get_Block_irg(block)));
env->modified = 1;
return;
}
......
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