Commit e7ed2daa authored by Michael Beck's avatar Michael Beck
Browse files

bugfix for x+~x

[r15793]
parent df3c852e
...@@ -2035,7 +2035,18 @@ static ir_node *transform_node_Add(ir_node *n) { ...@@ -2035,7 +2035,18 @@ static ir_node *transform_node_Add(ir_node *n) {
DBG_OPT_ALGSIM0(oldn, n, FS_OPT_NOT_PLUS_1); DBG_OPT_ALGSIM0(oldn, n, FS_OPT_NOT_PLUS_1);
return n; return n;
} }
if (a == b) { if (op == b) {
/* ~x + x = -1 */
ir_node *blk = get_irn_n(n, -1);
n = new_r_Const(current_ir_graph, blk, mode, get_mode_minus_one(mode));
DBG_OPT_ALGSIM0(oldn, n, FS_OPT_ADD_X_NOT_X);
return n;
}
}
if (is_Not(b)) {
ir_node *op = get_Not_op(b);
if (op == a) {
/* ~x + x = -1 */ /* ~x + x = -1 */
ir_node *blk = get_irn_n(n, -1); ir_node *blk = get_irn_n(n, -1);
n = new_r_Const(current_ir_graph, blk, mode, get_mode_minus_one(mode)); n = new_r_Const(current_ir_graph, blk, mode, get_mode_minus_one(mode));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment