X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fopt%2Freassoc.c;h=8cfcd8c2ecfed349f15eb90771454c6c2b84fe34;hb=5ea724df1266e369e815c99d861dcbbe102acb11;hp=2bdac4fa948b1f67ac1ca6b2530acfa7392dbb66;hpb=5c10d11631e4cef368025ee017c4791277d51132;p=libfirm diff --git a/ir/opt/reassoc.c b/ir/opt/reassoc.c index 2bdac4fa9..8cfcd8c2e 100644 --- a/ir/opt/reassoc.c +++ b/ir/opt/reassoc.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -168,12 +168,13 @@ static int reassoc_Sub(ir_node **in) /* already constant, nothing to do */ return 0; } + mode = get_irn_mode(n); dbi = get_irn_dbg_info(n); /* Beware of SubP(P, Is) */ irn = new_rd_Minus(dbi, current_ir_graph, block, right, rmode); - irn = new_rd_Add(dbi, current_ir_graph, block, left, irn, get_irn_mode(n)); + irn = new_rd_Add(dbi, current_ir_graph, block, left, irn, mode); DBG((dbg, LEVEL_5, "Applied: %n - %n => %n + (-%n)\n", get_Sub_left(n), right, get_Sub_left(n), right)); @@ -749,10 +750,6 @@ void optimize_reassociation(ir_graph *irg) assert(get_irg_pinned(irg) != op_pin_state_floats && "Reassociation needs pinned graph to work properly"); - /* reassociation needs constant folding */ - if (!get_opt_reassociation() || !get_opt_constant_folding()) - return; - rem = current_ir_graph; current_ir_graph = irg;