Both memory projs are involved in the transformation.
[libfirm] / ir / be / ia32 / ia32_finish.c
index 8a0c797..2e3519c 100644 (file)
@@ -41,7 +41,6 @@
 #include "bearch_ia32_t.h"
 #include "ia32_finish.h"
 #include "ia32_new_nodes.h"
-#include "ia32_map_regs.h"
 #include "ia32_common_transform.h"
 #include "ia32_transform.h"
 #include "ia32_dbg_stat.h"
@@ -111,7 +110,7 @@ static void ia32_transform_sub_to_neg_add(ir_node *irn)
                set_ia32_ls_mode(res, get_ia32_ls_mode(irn));
 
                /* exchange the add and the sub */
-               edges_reroute(irn, res, irg);
+               edges_reroute(irn, res);
 
                /* add to schedule */
                sched_add_before(irn, res);
@@ -149,12 +148,12 @@ static void ia32_transform_sub_to_neg_add(ir_node *irn)
                        set_ia32_commutative(res);
 
                        /* exchange the add and the sub */
-                       edges_reroute(irn, res, irg);
+                       edges_reroute(irn, res);
 
                        /* add to schedule */
                        sched_add_before(irn, res);
                } else {
-                       ir_node *stc, *cmc, *not, *adc;
+                       ir_node *stc, *cmc, *nnot, *adc;
                        ir_node *adc_flags;
 
                        /*
@@ -166,15 +165,15 @@ static void ia32_transform_sub_to_neg_add(ir_node *irn)
                         *
                         * a + -b = a + (~b + 1)  would set the carry flag IF a == b ...
                         */
-                       not = new_bd_ia32_Not(dbg, block, in2);
-                       arch_set_irn_register(not, in2_reg);
-                       sched_add_before(irn, not);
+                       nnot = new_bd_ia32_Not(dbg, block, in2);
+                       arch_set_irn_register(nnot, in2_reg);
+                       sched_add_before(irn, nnot);
 
                        stc = new_bd_ia32_Stc(dbg, block);
                        arch_set_irn_register(stc, &ia32_registers[REG_EFLAGS]);
                        sched_add_before(irn, stc);
 
-                       adc = new_bd_ia32_Adc(dbg, block, noreg, noreg, nomem, not, in1, stc);
+                       adc = new_bd_ia32_Adc(dbg, block, noreg, noreg, nomem, nnot, in1, stc);
                        arch_set_irn_register(adc, out_reg);
                        sched_add_before(irn, adc);
 
@@ -426,7 +425,7 @@ static void fix_am_source(ir_node *irn)
                                out_reg != arch_get_irn_register(get_irn_n(irn, n_ia32_index)))
                        continue;
 
-               load_res = turn_back_am(irn);
+               load_res = ia32_turn_back_am(irn);
                arch_set_irn_register(load_res, out_reg);
 
                DBG((dbg, LEVEL_3,
@@ -476,7 +475,7 @@ static void ia32_finish_irg_walker(ir_node *block, void *env)
  */
 static void ia32_push_on_queue_walker(ir_node *block, void *env)
 {
-       waitq *wq = env;
+       waitq *wq = (waitq*)env;
        waitq_put(wq, block);
 }
 
@@ -492,7 +491,7 @@ void ia32_finish_irg(ir_graph *irg)
        irg_block_walk_graph(irg, NULL, ia32_push_on_queue_walker, wq);
 
        while (! waitq_empty(wq)) {
-               ir_node *block = waitq_get(wq);
+               ir_node *block = (ir_node*)waitq_get(wq);
                ia32_finish_irg_walker(block, NULL);
        }
        del_waitq(wq);