summaryrefslogtreecommitdiffhomepage
path: root/ir/be
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2019-03-04 20:35:16 +0100
committerChristoph Mallon <christoph.mallon@gmx.de>2019-04-05 20:44:55 +0200
commit2d1d9840a3fb6aa791ff7c077a5e90d0fa49d02e (patch)
tree754db5ec4e83caa442e82334a7a0fac367b136f3 /ir/be
parent0d9e5f5dc1737e721fa2cdbd41f497dff94ebf26 (diff)
beasm: Allow be_Asm nodes as control flow nodes.
This is done by treating them as fragile.
Diffstat (limited to 'ir/be')
-rw-r--r--ir/be/beasm.c5
-rw-r--r--ir/be/benode.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/ir/be/beasm.c b/ir/be/beasm.c
index 2c26843..89eb87c 100644
--- a/ir/be/beasm.c
+++ b/ir/be/beasm.c
@@ -346,6 +346,11 @@ ir_node *be_make_asm(ir_node const *const node, be_asm_info_t const *const info,
arch_register_req_t const **const dup_in_reqs = DUP_ARR_D(arch_register_req_t const*, obst, in_reqs);
ir_node *const new_node = be_new_Asm(dbgi, block, n_ins, in, dup_in_reqs, n_outs, text, operands);
+ if (n_labels != 0) {
+ ir_set_throws_exception(new_node, true);
+ set_irn_pinned(new_node, op_pin_state_pinned);
+ }
+
for (unsigned i = 0; i != ARRAY_SIZE(add_pressure); ++i) {
if (add_pressure[i] != 0) {
arch_register_class_t const *const cls = &ir_target.isa->register_classes[i];
diff --git a/ir/be/benode.c b/ir/be/benode.c
index 5879123..b6cb9a0 100644
--- a/ir/be/benode.c
+++ b/ir/be/benode.c
@@ -641,7 +641,7 @@ void be_init_op(void)
/* Acquire all needed opcodes. */
unsigned const o = get_next_ir_opcodes(beo_last + 1);
- op_be_Asm = new_be_op(o + beo_Asm, "be_Asm", op_pin_state_exc_pinned, irop_flag_uses_memory, sizeof(be_asm_attr_t));
+ op_be_Asm = new_be_op(o + beo_Asm, "be_Asm", op_pin_state_exc_pinned, irop_flag_fragile | irop_flag_uses_memory, sizeof(be_asm_attr_t));
op_be_Copy = new_be_op(o + beo_Copy, "be_Copy", op_pin_state_floats, irop_flag_none, 0);
op_be_CopyKeep = new_be_op(o + beo_CopyKeep, "be_CopyKeep", op_pin_state_floats, irop_flag_keep, 0);
op_be_IncSP = new_be_op(o + beo_IncSP, "be_IncSP", op_pin_state_pinned, irop_flag_none, sizeof(be_incsp_attr_t));
@@ -652,6 +652,7 @@ void be_init_op(void)
op_be_Start = new_be_op(o + beo_Start, "be_Start", op_pin_state_pinned, irop_flag_start_block, 0);
op_be_Unknown = new_be_op(o + beo_Unknown, "be_Unknown", op_pin_state_floats, irop_flag_constlike, 0);
+ ir_op_set_fragile_indices(op_be_Asm, pn_be_Asm_X_regular, (unsigned)-1);
ir_op_set_memory_index(op_be_Asm, pn_be_Asm_M);
set_op_attrs_equal(op_be_Asm, be_asm_attr_equal);