Commit 88b21469 authored by Christoph Mallon's avatar Christoph Mallon
Browse files

amd64, ia32: Put the push of the old frame pointer into memory monad.

parent b598c2b5
......@@ -209,12 +209,12 @@ push_am => {
push_reg => {
op_flags => [ "uses_memory" ],
state => "exc_pinned",
in_reqs => [ "rsp", "gp" ],
out_reqs => [ "rsp:I" ],
ins => [ "stack", "val" ],
outs => [ "stack" ],
in_reqs => [ "rsp", "mem", "gp" ],
ins => [ "stack", "mem", "val" ],
out_reqs => [ "rsp:I", "mem" ],
outs => [ "stack", "M" ],
fixed => "amd64_op_mode_t op_mode = AMD64_OP_NONE;\n",
emit => "pushq %^S1",
emit => "pushq %^S2",
},
pop_am => {
......
......@@ -565,12 +565,14 @@ static void introduce_prologue(ir_graph *const irg)
if (!layout->sp_relative) {
/* push rbp */
ir_node *const mem = get_irg_initial_mem(irg);
ir_node *const initial_bp = be_get_initial_reg_value(irg, bp);
ir_node *const push = new_bd_amd64_push_reg(NULL, block, initial_sp, initial_bp);
ir_node *const push = new_bd_amd64_push_reg(NULL, block, initial_sp, mem, initial_bp);
sched_add_after(start, push);
ir_node *const curr_mem = be_new_Proj(push, pn_amd64_push_reg_M);
edges_reroute_except(mem, curr_mem, push);
ir_node *const curr_sp = be_new_Proj(push, pn_amd64_push_reg_stack);
arch_set_irn_register(curr_sp, sp);
sched_add_after(start, push);
/* move rsp to rbp */
ir_node *const curr_bp = be_new_Copy(block, curr_sp);
......
......@@ -1066,10 +1066,11 @@ static void introduce_prologue(ir_graph *const irg)
ir_node *const noreg = ia32_new_NoReg_gp(irg);
ir_node *const initial_bp = be_get_initial_reg_value(irg, bp);
ir_node *const push = new_bd_ia32_Push(NULL, block, noreg, noreg, mem, initial_bp, initial_sp, ia32_mode_gp);
sched_add_after(start, push);
ir_node *const curr_mem = be_new_Proj(push, pn_ia32_Push_M);
edges_reroute_except(mem, curr_mem, push);
ir_node *const curr_sp = be_new_Proj(push, pn_ia32_Push_stack);
arch_set_irn_register(curr_sp, sp);
sched_add_after(start, push);
/* move esp to ebp */
ir_node *const curr_bp = be_new_Copy(block, curr_sp);
......
Markdown is supported
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