Commit 130e13ee authored by Matthias Braun's avatar Matthias Braun
Browse files

amd64: more immediate kind asserts, remove entity after frame offset is decided

parent 55772c88
......@@ -260,6 +260,7 @@ static void amd64_emit_addr(const ir_node *const node,
{
ir_entity *entity = addr->immediate.entity;
if (entity != NULL) {
assert(addr->immediate.kind != X86_IMM_VALUE);
if (is_fp_relative(entity)) {
entity = NULL; /* only emit offset for frame entities */
} else {
......@@ -275,6 +276,7 @@ static void amd64_emit_addr(const ir_node *const node,
if (entity != NULL) {
be_emit_irprintf("%+" PRId32, offset);
} else {
assert(addr->immediate.kind == X86_IMM_VALUE);
be_emit_irprintf("%" PRId32, offset);
}
}
......
......@@ -92,6 +92,8 @@ static void amd64_set_frame_offset(ir_node *node, int offset)
if (layout->sp_relative)
attr->addr.immediate.offset -= get_insn_mode_bytes(attr->insn_mode);
}
attr->addr.immediate.kind = X86_IMM_VALUE;
attr->addr.immediate.entity = NULL;
}
static int amd64_get_sp_bias(const ir_node *node)
......
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