X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbestack.c;h=a28b4a43ad5a7bfbbe110587160c9581533dc8e8;hb=5474a1c188c9d59eea2c915515980cd9cbab58d8;hp=90b840719d01e29cd4d2c273fa9315cc3a8e1ae5;hpb=d8e2e801254f56a80c47dbb610d1af7f055b14d3;p=libfirm diff --git a/ir/be/bestack.c b/ir/be/bestack.c index 90b840719..a28b4a43a 100644 --- a/ir/be/bestack.c +++ b/ir/be/bestack.c @@ -20,7 +20,6 @@ /** * @file * @author Sebastian Hack, Matthias Braun - * @version $Id$ * * Handling of the stack frame. It is composed of three types: * 1) The type of the arguments which are pushed on the stack. @@ -185,34 +184,24 @@ static int process_stack_bias(ir_node *bl, int real_bias) if (be_is_IncSP(irn)) { ofs = be_get_IncSP_offset(irn); /* fill in real stack frame size */ - if (ofs == BE_STACK_FRAME_SIZE_EXPAND) { - ir_type *frame_type = get_irg_frame_type(irg); - ofs = (int) get_type_size_bytes(frame_type); - be_set_IncSP_offset(irn, ofs); - } else if (ofs == BE_STACK_FRAME_SIZE_SHRINK) { - ir_type *frame_type = get_irg_frame_type(irg); - ofs = - (int)get_type_size_bytes(frame_type); - be_set_IncSP_offset(irn, ofs); + if (be_get_IncSP_align(irn)) { + /* patch IncSP to produce an aligned stack pointer */ + ir_type *between_type = layout->between_type; + int between_size = get_type_size_bytes(between_type); + int alignment = 1 << arch_env->stack_alignment; + int delta = (real_bias + ofs + between_size) & (alignment - 1); + assert(ofs >= 0); + if (delta > 0) { + be_set_IncSP_offset(irn, ofs + alignment - delta); + real_bias += alignment - delta; + } } else { - if (be_get_IncSP_align(irn)) { - /* patch IncSP to produce an aligned stack pointer */ - ir_type *between_type = layout->between_type; - int between_size = get_type_size_bytes(between_type); - int alignment = 1 << arch_env->stack_alignment; - int delta = (real_bias + ofs + between_size) & (alignment - 1); - assert(ofs >= 0); - if (delta > 0) { - be_set_IncSP_offset(irn, ofs + alignment - delta); - real_bias += alignment - delta; - } - } else { - /* adjust so real_bias corresponds with wanted_bias */ - int delta = wanted_bias - real_bias; - assert(delta <= 0); - if (delta != 0) { - be_set_IncSP_offset(irn, ofs + delta); - real_bias += delta; - } + /* adjust so real_bias corresponds with wanted_bias */ + int delta = wanted_bias - real_bias; + assert(delta <= 0); + if (delta != 0) { + be_set_IncSP_offset(irn, ofs + delta); + real_bias += delta; } } real_bias += ofs; @@ -293,12 +282,12 @@ static void collect_stack_nodes_walker(ir_node *node, void *data) insn = get_Proj_pred(node); } - if (arch_irn_get_n_outs(insn) == 0) + if (arch_get_irn_n_outs(insn) == 0) return; if (get_irn_mode(node) == mode_T) return; - req = arch_get_register_req_out(node); + req = arch_get_irn_register_req(node); if (! (req->type & arch_register_req_type_produces_sp)) return;