Use a simpler stack optimization test to avoid having ICE message with absolute paths as expected output

This commit is contained in:
Kamil Śliwak 2021-07-01 17:29:24 +02:00
parent 753f359157
commit e3b345e5f0
4 changed files with 41 additions and 363 deletions

View File

@ -5,43 +5,14 @@
"A":
{
"content": "{
function fun() -> a3, b3, c3, d3, e3, f3, g3, h3, i3, j3, k3, l3, m3, n3, o3, p3
{
let a := 1
let b := 1
let z3 := 1
sstore(a, b)
sstore(add(a, 1), b)
sstore(add(a, 2), b)
sstore(add(a, 3), b)
sstore(add(a, 4), b)
sstore(add(a, 5), b)
sstore(add(a, 6), b)
sstore(add(a, 7), b)
sstore(add(a, 8), b)
sstore(add(a, 9), b)
sstore(add(a, 10), b)
sstore(add(a, 11), b)
sstore(add(a, 12), b)
a3 := 1
b3 := 1
c3 := 1
d3 := 1
e3 := 1
f3 := 1
g3 := 1
h3 := 1
i3 := 1
j3 := 1
k3 := 1
l3 := 1
m3 := 1
o3 := 1
p3 := 1
let x := 1
sstore(0, x)
}
{
let y := 2
sstore(32, y)
}
let a1, b1, c1, d1, e1, f1, g1, h1, i1, j1, k1, l1, m1, n1, o1, p1 := fun()
let a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2 := fun()
sstore(a1, a2)
}"
}
},

View File

@ -1,304 +1,17 @@
{"contracts":{"A":{"object":{"evm":{"assembly":" /* \"A\":645:650 */
tag_1
tag_2
jump\t// in
tag_1:
/* \"A\":575:650 */
pop
pop
pop
pop
pop
pop
pop
pop
pop
pop
pop
pop
pop
pop
pop
/* \"A\":722:727 */
tag_3
tag_2
jump\t// in
tag_3:
/* \"A\":652:727 */
pop
pop
pop
pop
pop
pop
pop
pop
pop
pop
pop
pop
pop
pop
pop
/* \"A\":740:742 */
{"contracts":{"A":{"object":{"evm":{"assembly":" /* \"A\":16:17 */
0x01
dup1
/* \"A\":736:738 */
dup3
/* \"A\":729:743 */
/* \"A\":27:28 */
0x00
/* \"A\":20:32 */
sstore
pop
pop
/* \"A\":3:573 */
jump(tag_4)
tag_2:
/* \"A\":98:99 */
0x01
0x01
/* \"A\":129:141 */
sstore
/* \"A\":98:99 */
0x01
0x01
0x01
/* \"A\":151:160 */
add
/* \"A\":144:164 */
sstore
/* \"A\":98:99 */
0x01
/* \"A\":181:182 */
/* \"A\":50:51 */
0x02
/* \"A\":98:99 */
0x01
/* \"A\":174:183 */
add
/* \"A\":167:187 */
sstore
/* \"A\":98:99 */
0x01
/* \"A\":204:205 */
0x03
/* \"A\":98:99 */
0x01
/* \"A\":197:206 */
add
/* \"A\":190:210 */
sstore
/* \"A\":98:99 */
0x01
/* \"A\":227:228 */
0x04
/* \"A\":98:99 */
0x01
/* \"A\":220:229 */
add
/* \"A\":213:233 */
sstore
/* \"A\":98:99 */
0x01
/* \"A\":250:251 */
0x05
/* \"A\":98:99 */
0x01
/* \"A\":243:252 */
add
/* \"A\":236:256 */
sstore
/* \"A\":98:99 */
0x01
/* \"A\":273:274 */
0x06
/* \"A\":98:99 */
0x01
/* \"A\":266:275 */
add
/* \"A\":259:279 */
sstore
/* \"A\":98:99 */
0x01
/* \"A\":296:297 */
0x07
/* \"A\":98:99 */
0x01
/* \"A\":289:298 */
add
/* \"A\":282:302 */
sstore
/* \"A\":98:99 */
0x01
/* \"A\":319:320 */
0x08
/* \"A\":98:99 */
0x01
/* \"A\":312:321 */
add
/* \"A\":305:325 */
sstore
/* \"A\":98:99 */
0x01
/* \"A\":342:343 */
0x09
/* \"A\":98:99 */
0x01
/* \"A\":335:344 */
add
/* \"A\":328:348 */
sstore
/* \"A\":98:99 */
0x01
/* \"A\":365:367 */
0x0a
/* \"A\":98:99 */
0x01
/* \"A\":358:368 */
add
/* \"A\":351:372 */
sstore
/* \"A\":98:99 */
0x01
/* \"A\":389:391 */
0x0b
/* \"A\":98:99 */
0x01
/* \"A\":382:392 */
add
/* \"A\":375:396 */
sstore
/* \"A\":98:99 */
0x01
/* \"A\":413:415 */
0x0c
/* \"A\":98:99 */
0x01
/* \"A\":406:416 */
add
/* \"A\":399:420 */
sstore
/* \"A\":21:23 */
0x00
/* \"A\":25:27 */
0x00
/* \"A\":29:31 */
0x00
/* \"A\":33:35 */
0x00
/* \"A\":37:39 */
0x00
/* \"A\":41:43 */
0x00
/* \"A\":45:47 */
0x00
/* \"A\":49:51 */
0x00
/* \"A\":53:55 */
0x00
/* \"A\":57:59 */
0x00
dup1
/* \"A\":61:63 */
0x00
/* \"A\":65:67 */
0x00
/* \"A\":69:71 */
0x00
/* \"A\":73:75 */
0x00
/* \"A\":77:79 */
0x00
/* \"A\":81:83 */
0x00
/* \"A\":98:99 */
0x01
/* \"A\":423:430 */
swap16
0x20
/* \"A\":54:67 */
sstore
pop
/* \"A\":98:99 */
dup16
/* \"A\":433:440 */
swap15
pop
/* \"A\":98:99 */
dup16
/* \"A\":443:450 */
swap14
pop
/* \"A\":98:99 */
dup16
/* \"A\":453:460 */
swap13
pop
/* \"A\":98:99 */
dup16
/* \"A\":463:470 */
swap12
pop
/* \"A\":98:99 */
dup16
/* \"A\":473:480 */
swap11
pop
/* \"A\":98:99 */
dup16
/* \"A\":483:490 */
swap10
pop
/* \"A\":98:99 */
dup16
/* \"A\":493:500 */
swap9
pop
/* \"A\":98:99 */
dup16
/* \"A\":503:510 */
swap8
pop
/* \"A\":98:99 */
dup16
/* \"A\":513:520 */
swap7
pop
/* \"A\":98:99 */
dup16
/* \"A\":523:530 */
swap6
pop
/* \"A\":98:99 */
dup16
/* \"A\":533:540 */
swap5
pop
/* \"A\":98:99 */
dup16
/* \"A\":543:550 */
swap4
pop
/* \"A\":98:99 */
dup16
/* \"A\":553:560 */
swap2
pop
/* \"A\":98:99 */
dup16
/* \"A\":563:570 */
swap1
pop
/* \"A\":85:573 */
tag_5:
swap1
swap2
swap3
swap4
swap5
swap6
swap7
swap8
swap9
swap10
swap11
swap12
swap13
swap14
swap15
swap16
jump\t// out
tag_4:
"}}}},"errors":[{"component":"general","formattedMessage":"Yul is still experimental. Please use the output with care.","message":"Yul is still experimental. Please use the output with care.","severity":"warning","type":"Warning"}]}

View File

@ -5,30 +5,15 @@
"A":
{
"content": "{
function fun() -> a3, b3, c3, d3, e3, f3, g3, h3, i3, j3, k3, l3, m3, n3, o3, p3
{
let a := 1
let b := 1
let z3 := 1
sstore(a, b)
sstore(add(a, 1), b)
sstore(add(a, 2), b)
sstore(add(a, 3), b)
sstore(add(a, 4), b)
sstore(add(a, 5), b)
sstore(add(a, 6), b)
sstore(add(a, 7), b)
sstore(add(a, 8), b)
sstore(add(a, 9), b)
sstore(add(a, 10), b)
sstore(add(a, 11), b)
sstore(add(a, 12), b)
let x := 1
sstore(0, x)
}
let a1, b1, c1, d1, e1, f1, g1, h1, i1, j1, k1, l1, m1, n1, o1, p1 := fun()
let a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2 := fun()
sstore(a1, a2)
}
"
{
let y := 2
sstore(32, y)
}
}"
}
},
"settings":

View File

@ -1,9 +1,18 @@
{"errors":[{"component":"general","formattedMessage":"Internal exception in StandardCompiler::compile: /solidity/libyul/backends/evm/EVMObjectCompiler.cpp(70): Throw in function void solidity::yul::EVMObjectCompiler::run(solidity::yul::Object&, bool)
Dynamic exception type: boost::wrapexcept<solidity::yul::StackTooDeepError>
std::exception::what: Variable a1 is 17 slot(s) too deep inside the stack.
[solidity::util::tag_comment*] = Variable a1 is 17 slot(s) too deep inside the stack.
","message":"Internal exception in StandardCompiler::compile: /solidity/libyul/backends/evm/EVMObjectCompiler.cpp(70): Throw in function void solidity::yul::EVMObjectCompiler::run(solidity::yul::Object&, bool)
Dynamic exception type: boost::wrapexcept<solidity::yul::StackTooDeepError>
std::exception::what: Variable a1 is 17 slot(s) too deep inside the stack.
[solidity::util::tag_comment*] = Variable a1 is 17 slot(s) too deep inside the stack.
","severity":"error","type":"InternalCompilerError"}]}
{"contracts":{"A":{"object":{"evm":{"assembly":" /* \"A\":16:17 */
0x01
dup1
/* \"A\":27:28 */
0x00
/* \"A\":20:32 */
sstore
/* \"A\":50:51 */
0x02
dup1
/* \"A\":61:63 */
0x20
/* \"A\":54:67 */
sstore
/* \"A\":0:72 */
pop
pop
"}}}},"errors":[{"component":"general","formattedMessage":"Yul is still experimental. Please use the output with care.","message":"Yul is still experimental. Please use the output with care.","severity":"warning","type":"Warning"}]}