X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firop.c;h=31adf0cd5dadaf664af66b27620bf41befc3552e;hb=357886575cb0becb5bd9be376fde49b57edd5385;hp=82d2f144d66be28168cab7c6d2fbdad013ca230d;hpb=0df5e0ea5d4d6a566339ac4b93a73719858e81e1;p=libfirm diff --git a/ir/ir/irop.c b/ir/ir/irop.c index 82d2f144d..31adf0cd5 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); } @@ -165,7 +166,7 @@ ir_op *new_ir_op(unsigned code, const char *name, op_pin_state p, res->tag = 0; if (ops) - memcpy(&res->ops, ops, sizeof(res->ops)); + res->ops = *ops; else /* no given ops, set all operations to NULL */ memset(&res->ops, 0, sizeof(res->ops)); @@ -188,6 +189,14 @@ void free_ir_op(ir_op *code) free(code); } /* free_ir_op */ +void ir_op_set_fragile_indices(ir_op *op, int fragile_mem_index, + int pn_x_regular, int pn_x_except) +{ + op->fragile_mem_index = fragile_mem_index; + op->pn_x_regular = pn_x_regular; + op->pn_x_except = pn_x_except; +} + /* Returns the string for the opcode. */ const char *get_op_name (const ir_op *op) {