Merge pull request #7425 from ethereum/fixOrderOpt

Fix order bug in optimizer.
This commit is contained in:
chriseth
2019-09-17 12:58:17 +02:00
committed by GitHub
3 changed files with 18 additions and 2 deletions
+1
View File
@@ -14,6 +14,7 @@ Compiler Features:
Bugfixes:
* Fix internal error when popping a dynamic storage array of mappings.
* Yul Optimizer: Fix reordering bug in connection with shifted one and mul/div-instructions in for loop conditions.
### 0.5.11 (2019-08-12)
+4 -2
View File
@@ -475,7 +475,8 @@ std::vector<SimplificationRule<Pattern>> simplificationRuleListPart7(
[=]() -> Pattern {
return {Instruction::SHL, {Y, X}};
},
false
// Actually only changes the order, does not remove.
true
});
rules.push_back({
// MUL(SHL(X, 1), Y) -> SHL(X, Y)
@@ -492,7 +493,8 @@ std::vector<SimplificationRule<Pattern>> simplificationRuleListPart7(
[=]() -> Pattern {
return {Instruction::SHR, {Y, X}};
},
false
// Actually only changes the order, does not remove.
true
});
std::function<bool()> feasibilityFunction = [=]() {
@@ -0,0 +1,13 @@
{
for {} div(create(0, 1, 0), shl(msize(), 1)) {}
{
}
}
// ====
// step: expressionSimplifier
// EVMVersion: >byzantium
// ----
// {
// for { } div(create(0, 1, 0), shl(msize(), 1)) { }
// { }
// }