Commit e3f2b412 authored by yb9976's avatar yb9976
Browse files

Turn conditions into assertions.

Otherwise, the code would be broken.
parent f0ad1ee3
...@@ -5372,8 +5372,8 @@ cmp_x_eq_0: ...@@ -5372,8 +5372,8 @@ cmp_x_eq_0:
(!tarval_is_all_one(tarval_or(max, b->z)) || (!tarval_is_all_one(tarval_or(max, b->z)) ||
!tarval_is_null(tarval_and(b->o, max))))) { !tarval_is_null(tarval_and(b->o, max))))) {
tv = tarval_neg(tv); tv = tarval_neg(tv);
assert(tarval_is_constant(tv));
if (tarval_is_constant(tv)) {
left = op; left = op;
if (mode_is_int(mode) && rel_eq != ir_relation_false) { if (mode_is_int(mode) && rel_eq != ir_relation_false) {
relation = rel_eq; relation = rel_eq;
...@@ -5383,18 +5383,16 @@ cmp_x_eq_0: ...@@ -5383,18 +5383,16 @@ cmp_x_eq_0:
changedc = true; changedc = true;
DBG_OPT_ALGSIM0(n, n, FS_OPT_CMP_OP_C); DBG_OPT_ALGSIM0(n, n, FS_OPT_CMP_OP_C);
} }
}
} else if (is_Not(left) && rel_eq != ir_relation_false) { } else if (is_Not(left) && rel_eq != ir_relation_false) {
/* Not(a) ==/!= c ==> a ==/!= Not(c) */ /* Not(a) ==/!= c ==> a ==/!= Not(c) */
tv = tarval_not(tv); tv = tarval_not(tv);
assert(tarval_is_constant(tv));
if (tarval_is_constant(tv)) {
left = get_Not_op(left); left = get_Not_op(left);
relation = rel_eq; relation = rel_eq;
changedc = true; changedc = true;
DBG_OPT_ALGSIM0(n, n, FS_OPT_CMP_OP_C); DBG_OPT_ALGSIM0(n, n, FS_OPT_CMP_OP_C);
} }
}
/* for integer modes, we have more */ /* for integer modes, we have more */
if (mode_is_int(mode) && !is_Const(left)) { if (mode_is_int(mode) && !is_Const(left)) {
......
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