Skip to content

Commit fe7e385

Browse files
authored
Merge pull request #3177 from tautschnig/use-is_not_zero
Use is_not_zero in simplifier
2 parents 72708b5 + b98e818 commit fe7e385

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/util/simplify_expr.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -252,12 +252,7 @@ bool simplify_exprt::simplify_typecast(exprt &expr)
252252
op_type.id()!=ID_bool)
253253
{
254254
// rewrite (_Bool)x to (_Bool)(x!=0)
255-
binary_relation_exprt inequality;
256-
inequality.id(op_type.id()==ID_floatbv?ID_ieee_float_notequal:ID_notequal);
257-
inequality.add_source_location()=expr.source_location();
258-
inequality.lhs()=expr.op0();
259-
inequality.rhs()=from_integer(0, op_type);
260-
CHECK_RETURN(inequality.rhs().is_not_nil());
255+
exprt inequality = is_not_zero(expr.op0(), ns);
261256
simplify_node(inequality);
262257
expr.op0()=inequality;
263258
simplify_typecast(expr); // recursive call

0 commit comments

Comments
 (0)