We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 72708b5 + b98e818 commit fe7e385Copy full SHA for fe7e385
src/util/simplify_expr.cpp
@@ -252,12 +252,7 @@ bool simplify_exprt::simplify_typecast(exprt &expr)
252
op_type.id()!=ID_bool)
253
{
254
// 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());
+ exprt inequality = is_not_zero(expr.op0(), ns);
261
simplify_node(inequality);
262
expr.op0()=inequality;
263
simplify_typecast(expr); // recursive call
0 commit comments