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.
1 parent b091560 commit b663734Copy full SHA for b663734
src/util/simplify_expr_int.cpp
@@ -1147,6 +1147,32 @@ bool simplify_exprt::simplify_extractbits(extractbits_exprt &expr)
1147
1148
return false;
1149
}
1150
+ else if(expr.src().id() == ID_concatenation)
1151
+ {
1152
+ // the most-significant bit comes first in an concatenation_exprt, hence we
1153
+ // count down
1154
+ mp_integer offset = width;
1155
+
1156
+ forall_operands(it, expr.src())
1157
1158
+ mp_integer op_width = pointer_offset_bits(it->type(), ns);
1159
1160
+ if(op_width <= 0)
1161
+ return true;
1162
1163
+ if(start + 1 == offset && end + op_width == offset)
1164
1165
+ exprt tmp = *it;
1166
+ if(tmp.type() != expr.type())
1167
1168
1169
+ expr.swap(tmp);
1170
+ return false;
1171
+ }
1172
1173
+ offset -= op_width;
1174
1175
1176
1177
return true;
1178
0 commit comments