From 36e47204f1fa2bea28b50a40edae8e0ae07665f7 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Thu, 20 Sep 2007 17:58:14 +0000 Subject: [PATCH] Fix r15888. [r15907] --- ir/ir/iropt.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/ir/ir/iropt.c b/ir/ir/iropt.c index 9b2254397..d699c85b0 100644 --- a/ir/ir/iropt.c +++ b/ir/ir/iropt.c @@ -3055,7 +3055,14 @@ static ir_node *transform_node_Eor(ir_node *n) { DBG_OPT_ALGSIM0(oldn, n, FS_OPT_EOR_TO_NOT_BOOL); } else if (is_Const(b)) { if (is_Not(a)) { /* ~x ^ const -> x ^ ~const */ - n = new_Const(mode, tarval_not(get_Const_tarval(b))); + ir_node *cnst = new_Const(mode, tarval_not(get_Const_tarval(b))); + ir_node *not_op = get_Not_op(a); + dbg_info *dbg = get_irn_dbg_info(n); + ir_graph *irg = current_ir_graph; + ir_node *block = get_nodes_block(n); + ir_mode *mode = get_irn_mode(n); + n = new_rd_Eor(dbg, irg, block, not_op, cnst, mode); + return n; } else if (is_Const_all_one(b)) { /* x ^ 1...1 -> ~1 */ n = new_r_Not(current_ir_graph, get_nodes_block(n), a, mode); DBG_OPT_ALGSIM0(oldn, n, FS_OPT_EOR_TO_NOT); @@ -3090,7 +3097,13 @@ static ir_node *transform_node_Not(ir_node *n) { if (is_Eor(a)) { ir_node *eor_b = get_Eor_right(a); if (is_Const(eor_b)) { /* ~(x ^ const) -> x ^ ~const */ - n = new_Const(mode, tarval_not(get_Const_tarval(eor_b))); + ir_node *cnst = new_Const(mode, tarval_not(get_Const_tarval(eor_b))); + ir_node *eor_a = get_Eor_left(a); + dbg_info *dbg = get_irn_dbg_info(n); + ir_graph *irg = current_ir_graph; + ir_node *block = get_nodes_block(n); + ir_mode *mode = get_irn_mode(n); + n = new_rd_Eor(dbg, irg, block, eor_a, cnst, mode); return n; } } -- 2.20.1