X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firop.c;h=d4318f0fd7143ce42eb660a48b449bfaa2728bf4;hb=7d070c58e7bef1ed875fac066b57f29de449724b;hp=6efc3d5049e6569fdbe0b054fcdd1af7381fc0b3;hpb=ca42e4ac671c49f7ba8e9dfffd805abf49b2c733;p=libfirm diff --git a/ir/ir/irop.c b/ir/ir/irop.c index 6efc3d504..d4318f0fd 100644 --- a/ir/ir/irop.c +++ b/ir/ir/irop.c @@ -86,10 +86,11 @@ static void block_copy_attr(ir_graph *irg, const ir_node *old_node, new_node->attr.block.block_visited = 0; memset(&new_node->attr.block.dom, 0, sizeof(new_node->attr.block.dom)); memset(&new_node->attr.block.pdom, 0, sizeof(new_node->attr.block.pdom)); - /* TODO: we should probably create a new entity. But we somehow have to - * patch the stuff at the same time */ - new_node->attr.block.entity = NULL; - new_node->attr.block.phis = NULL; + /* It should be safe to copy the entity here, as it has no back-link to the old block. + * It serves just as a label number, so copying a labeled block results in an exact copy. + * This is at least what we need for DCE to work. */ + new_node->attr.block.entity = old_node->attr.block.entity; + new_node->attr.block.phis = NULL; INIT_LIST_HEAD(&new_node->attr.block.succ_head); } @@ -125,7 +126,7 @@ static void ASM_copy_attr(ir_graph *irg, const ir_node *old_node, * @return * The operations. */ -static ir_op_ops *firm_set_default_copy_attr(ir_opcode code, ir_op_ops *ops) +static ir_op_ops *firm_set_default_copy_attr(unsigned code, ir_op_ops *ops) { switch (code) { case iro_Call: @@ -171,7 +172,7 @@ ir_op *new_ir_op(unsigned code, const char *name, op_pin_state p, firm_set_default_operations(code, &res->ops); firm_set_default_copy_attr(code, &res->ops); - firm_set_default_verifyer(code, &res->ops); + firm_set_default_verifier(code, &res->ops); firm_set_default_reassoc(code, &res->ops); add_irp_opcode(res); @@ -264,7 +265,7 @@ const ir_op_ops *(get_op_ops)(const ir_op *op) irop_flags get_op_flags(const ir_op *op) { - return op->flags; + return (irop_flags)op->flags; } #include "gen_irop.c.inl"