Fix inconsistency between reg_req and ins of Push: reg_req expected the stack in...
authorChristoph Mallon <christoph.mallon@gmx.de>
Tue, 22 Apr 2008 14:41:59 +0000 (14:41 +0000)
committerChristoph Mallon <christoph.mallon@gmx.de>
Tue, 22 Apr 2008 14:41:59 +0000 (14:41 +0000)
[r19358]

ir/be/ia32/bearch_ia32.c
ir/be/ia32/ia32_optimize.c
ir/be/ia32/ia32_spec.pl

index b199cd6..f872202 100644 (file)
@@ -451,7 +451,7 @@ static const arch_register_t *ia32_abi_prologue(void *self, ir_node **mem, pmap
                be_node_set_flags(get_Proj_pred(curr_bp), BE_OUT_POS(get_Proj_proj(curr_bp)), arch_irn_flags_ignore);
 
                /* push ebp */
-               push    = new_rd_ia32_Push(NULL, env->irg, bl, noreg, noreg, *mem, curr_sp, curr_bp);
+               push    = new_rd_ia32_Push(NULL, env->irg, bl, noreg, noreg, *mem, curr_bp, curr_sp);
                curr_sp = new_r_Proj(env->irg, bl, push, get_irn_mode(curr_sp), pn_ia32_Push_stack);
                *mem    = new_r_Proj(env->irg, bl, push, mode_M, pn_ia32_Push_M);
 
@@ -1256,7 +1256,7 @@ static ir_node *create_push(ia32_code_gen_t *cg, ir_node *node, ir_node *schedpo
        ir_node *noreg = ia32_new_NoReg_gp(cg);
        ir_node *frame = get_irg_frame(irg);
 
-       ir_node *push = new_rd_ia32_Push(dbg, irg, block, frame, noreg, mem, sp, noreg);
+       ir_node *push = new_rd_ia32_Push(dbg, irg, block, frame, noreg, mem, noreg, sp);
 
        set_ia32_frame_ent(push, ent);
        set_ia32_use_frame(push);
index 1f5fa6d..b6fc4d7 100644 (file)
@@ -119,7 +119,7 @@ static void peephole_ia32_Store_IncSP_to_push(ir_node *node)
        noreg = ia32_new_NoReg_gp(cg);
        base  = be_get_IncSP_pred(incsp);
        val   = get_irn_n(node, n_ia32_Store_val);
-       push  = new_rd_ia32_Push(dbgi, irg, block, noreg, noreg, mem, base, val);
+       push  = new_rd_ia32_Push(dbgi, irg, block, noreg, noreg, mem, val, base);
 
        proj  = new_r_Proj(irg, block, push, mode_M, pn_ia32_Push_M);
 
@@ -451,7 +451,7 @@ static void peephole_IncSP_Store_to_push(ir_node *irn)
                mem = get_irn_n(store, n_ia32_mem);
                spreg = arch_get_irn_register(cg->arch_env, curr_sp);
 
-               push = new_rd_ia32_Push(get_irn_dbg_info(store), irg, block, noreg, noreg, mem, curr_sp, val);
+               push = new_rd_ia32_Push(get_irn_dbg_info(store), irg, block, noreg, noreg, mem, val, curr_sp);
 
                sched_add_before(irn, push);
 
index 4b8d1d6..84c2425 100644 (file)
@@ -1365,9 +1365,9 @@ Lea => {
 
 Push => {
        state     => "exc_pinned",
-       reg_req   => { in => [ "gp", "gp", "none", "esp", "gp" ], out => [ "esp", "none" ] },
+       reg_req   => { in => [ "gp", "gp", "none", "gp", "esp" ], out => [ "esp", "none" ] },
        ins       => [ "base", "index", "mem", "val", "stack" ],
-       emit      => '. push%M %unop4',
+       emit      => '. push%M %unop3',
        outs      => [ "stack:I|S", "M" ],
        am        => "source,binary",
        latency   => 2,