set current_ir_graph while reassoc runs
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Fri, 28 Sep 2007 21:34:00 +0000 (21:34 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Fri, 28 Sep 2007 21:34:00 +0000 (21:34 +0000)
[r15989]

ir/opt/reassoc.c

index 4e267df..de5b6dd 100644 (file)
@@ -735,6 +735,7 @@ void optimize_reassociation(ir_graph *irg)
 {
        walker_t env;
        irg_loopinfo_state state;
+       ir_graph *rem;
 
        assert(get_irg_phase_state(irg) != phase_building);
        assert(get_irg_pinned(irg) != op_pin_state_floats &&
@@ -744,6 +745,9 @@ void optimize_reassociation(ir_graph *irg)
        if (!get_opt_reassociation() || !get_opt_constant_folding())
                return;
 
+       rem = current_ir_graph;
+       current_ir_graph = irg;
+
        /* we use dominance to detect dead blocks */
        assure_doms(irg);
 
@@ -780,6 +784,7 @@ void optimize_reassociation(ir_graph *irg)
        }
 
        del_waitq(env.wq);
+       current_ir_graph = rem;
 }  /* optimize_reassociation */
 
 /* Sets the default reassociation operation for an ir_op_ops. */