diff --git a/Changelog.md b/Changelog.md index 38615f53d..c9179ba3b 100644 --- a/Changelog.md +++ b/Changelog.md @@ -6,6 +6,8 @@ Language Features: Compiler Features: + * Code Generator: Insert helper functions for panic codes instead of inlining unconditionally. This can reduce costs if many panics (checks) are inserted, + but can increase costs where few panics are used. * EVM: Set the default EVM version to "Berlin". * SMTChecker: Function definitions can be annotated with the custom Natspec tag ``custom:smtchecker abstract-function-nondet`` to be abstracted by a nondeterministic value when called. * Standard JSON / combined JSON: New artifact "functionDebugData" that contains bytecode offsets of entry points of functions and potentially more information in the future. diff --git a/libsolidity/codegen/CompilerContext.cpp b/libsolidity/codegen/CompilerContext.cpp index f86ca506d..398e362f5 100644 --- a/libsolidity/codegen/CompilerContext.cpp +++ b/libsolidity/codegen/CompilerContext.cpp @@ -334,14 +334,7 @@ CompilerContext& CompilerContext::appendJump(evmasm::AssemblyItem::JumpType _jum CompilerContext& CompilerContext::appendPanic(util::PanicCode _code) { - Whiskers templ(R"({ - mstore(0, ) - mstore(4, ) - revert(0, 0x24) - })"); - templ("selector", util::selectorFromSignature("Panic(uint256)").str()); - templ("code", toCompactHexWithPrefix(static_cast(_code))); - appendInlineAssembly(templ.render()); + callYulFunction(utilFunctions().panicFunction(_code), 0, 0); return *this; } diff --git a/test/cmdlineTests/function_debug_info/output b/test/cmdlineTests/function_debug_info/output index 4889b15ea..071e0076e 100644 --- a/test/cmdlineTests/function_debug_info/output +++ b/test/cmdlineTests/function_debug_info/output @@ -35,13 +35,13 @@ }, "abi_decode_tuple_t_array$_t_uint256_$dyn_calldata_ptr": { - "entryPoint": 178, + "entryPoint": 164, "parameterSlots": 2, "returnSlots": 2 }, "abi_decode_tuple_t_uint256": { - "entryPoint": 295, + "entryPoint": 281, "parameterSlots": 2, "returnSlots": 1 }, @@ -49,6 +49,12 @@ { "parameterSlots": 2, "returnSlots": 1 + }, + "panic_error_0x32": + { + "entryPoint": 306, + "parameterSlots": 0, + "returnSlots": 0 } } } diff --git a/test/cmdlineTests/optimizer_inliner_dynamic_reference/output b/test/cmdlineTests/optimizer_inliner_dynamic_reference/output index c5b1ba893..1f5597478 100644 --- a/test/cmdlineTests/optimizer_inliner_dynamic_reference/output +++ b/test/cmdlineTests/optimizer_inliner_dynamic_reference/output @@ -145,9 +145,11 @@ sub_0: assembly { /* "optimizer_inliner_dynamic_reference/input.sol":310:365 function f() internal pure returns (uint) { return 6; } */ jump // out tag_20: - mstore(0x00, shl(0xe0, 0x4e487b71)) - mstore(0x04, 0x51) - revert(0x00, 0x24) + tag_25 + tag_26 + jump // in + tag_25: + jump // out /* "#utility.yul":196:421 */ tag_22: /* "#utility.yul":236:239 */ @@ -162,7 +164,7 @@ sub_0: assembly { gt /* "#utility.yul":254:256 */ iszero - tag_28 + tag_30 jumpi /* "#utility.yul":312:322 */ 0x4e487b71 @@ -187,13 +189,37 @@ sub_0: assembly { /* "#utility.yul":365:380 */ revert /* "#utility.yul":254:256 */ - tag_28: + tag_30: pop /* "#utility.yul":406:415 */ add swap1 /* "#utility.yul":244:421 */ jump // out + /* "#utility.yul":426:553 */ + tag_26: + /* "#utility.yul":487:497 */ + 0x4e487b71 + /* "#utility.yul":482:485 */ + 0xe0 + /* "#utility.yul":478:498 */ + shl + /* "#utility.yul":475:476 */ + 0x00 + /* "#utility.yul":468:499 */ + mstore + /* "#utility.yul":518:522 */ + 0x51 + /* "#utility.yul":515:516 */ + 0x04 + /* "#utility.yul":508:523 */ + mstore + /* "#utility.yul":542:546 */ + 0x24 + /* "#utility.yul":539:540 */ + 0x00 + /* "#utility.yul":532:547 */ + revert auxdata: } diff --git a/test/cmdlineTests/optimizer_inliner_dynamic_reference_constructor/output b/test/cmdlineTests/optimizer_inliner_dynamic_reference_constructor/output index 21d730f52..f17c19176 100644 --- a/test/cmdlineTests/optimizer_inliner_dynamic_reference_constructor/output +++ b/test/cmdlineTests/optimizer_inliner_dynamic_reference_constructor/output @@ -150,9 +150,11 @@ sub_0: assembly { /* "optimizer_inliner_dynamic_reference_constructor/input.sol":304:359 function f() internal pure returns (uint) { return 6; } */ jump // out tag_17: - mstore(0x00, shl(0xe0, 0x4e487b71)) - mstore(0x04, 0x51) - revert(0x00, 0x24) + tag_21 + tag_22 + jump // in + tag_21: + jump // out /* "#utility.yul":196:421 */ tag_19: /* "#utility.yul":236:239 */ @@ -167,7 +169,7 @@ sub_0: assembly { gt /* "#utility.yul":254:256 */ iszero - tag_24 + tag_26 jumpi /* "#utility.yul":312:322 */ 0x4e487b71 @@ -192,13 +194,37 @@ sub_0: assembly { /* "#utility.yul":365:380 */ revert /* "#utility.yul":254:256 */ - tag_24: + tag_26: pop /* "#utility.yul":406:415 */ add swap1 /* "#utility.yul":244:421 */ jump // out + /* "#utility.yul":426:553 */ + tag_22: + /* "#utility.yul":487:497 */ + 0x4e487b71 + /* "#utility.yul":482:485 */ + 0xe0 + /* "#utility.yul":478:498 */ + shl + /* "#utility.yul":475:476 */ + 0x00 + /* "#utility.yul":468:499 */ + mstore + /* "#utility.yul":518:522 */ + 0x51 + /* "#utility.yul":515:516 */ + 0x04 + /* "#utility.yul":508:523 */ + mstore + /* "#utility.yul":542:546 */ + 0x24 + /* "#utility.yul":539:540 */ + 0x00 + /* "#utility.yul":532:547 */ + revert auxdata: } diff --git a/test/cmdlineTests/standard_function_debug_info/output.json b/test/cmdlineTests/standard_function_debug_info/output.json index 5dc180875..e0e6d7257 100644 --- a/test/cmdlineTests/standard_function_debug_info/output.json +++ b/test/cmdlineTests/standard_function_debug_info/output.json @@ -1 +1 @@ -{"contracts":{"a.sol":{"A":{"evm":{"bytecode":{"functionDebugData":{}},"deployedBytecode":{"functionDebugData":{"@f_19":{"entryPoint":96,"id":19,"parameterSlots":1,"returnSlots":1},"abi_decode_available_length_t_array$_t_uint256_$dyn_memory_ptr":{"entryPoint":247,"id":null,"parameterSlots":3,"returnSlots":1},"abi_decode_t_array$_t_uint256_$dyn_memory_ptr":{"entryPoint":359,"id":null,"parameterSlots":2,"returnSlots":1},"abi_decode_t_uint256":{"entryPoint":405,"id":null,"parameterSlots":2,"returnSlots":1},"abi_decode_tuple_t_array$_t_uint256_$dyn_memory_ptr":{"entryPoint":426,"id":null,"parameterSlots":2,"returnSlots":1},"abi_encode_t_uint256_to_t_uint256_fromStack":{"entryPoint":499,"id":null,"parameterSlots":2,"returnSlots":0},"abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed":{"entryPoint":514,"id":null,"parameterSlots":2,"returnSlots":1},"allocate_memory":{"entryPoint":541,"id":null,"parameterSlots":1,"returnSlots":1},"allocate_unbounded":{"entryPoint":568,"id":null,"parameterSlots":0,"returnSlots":1},"array_allocation_size_t_array$_t_uint256_$dyn_memory_ptr":{"entryPoint":578,"id":null,"parameterSlots":1,"returnSlots":1},"checked_add_t_uint256":{"entryPoint":622,"id":null,"parameterSlots":2,"returnSlots":1},"cleanup_t_uint256":{"entryPoint":708,"id":null,"parameterSlots":1,"returnSlots":1},"finalize_allocation":{"entryPoint":718,"id":null,"parameterSlots":2,"returnSlots":0},"panic_error_0x11":{"entryPoint":767,"id":null,"parameterSlots":0,"returnSlots":0},"panic_error_0x41":{"entryPoint":814,"id":null,"parameterSlots":0,"returnSlots":0},"revert_error_1b9f4a0a5773e33b91aa01db23bf8c55fce1411167c872835e7fa00a4f17d46d":{"entryPoint":861,"id":null,"parameterSlots":0,"returnSlots":0},"revert_error_81385d8c0b31fffe14be1da910c8bd3a80be4cfa248e04f42ec0faea3132a8ef":{"entryPoint":866,"id":null,"parameterSlots":0,"returnSlots":0},"revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db":{"entryPoint":871,"id":null,"parameterSlots":0,"returnSlots":0},"revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b":{"entryPoint":876,"id":null,"parameterSlots":0,"returnSlots":0},"round_up_to_mul_of_32":{"entryPoint":881,"id":null,"parameterSlots":1,"returnSlots":1},"validator_revert_t_uint256":{"entryPoint":898,"id":null,"parameterSlots":1,"returnSlots":0}}}}}}},"sources":{"a.sol":{"id":0}}} +{"contracts":{"a.sol":{"A":{"evm":{"bytecode":{"functionDebugData":{}},"deployedBytecode":{"functionDebugData":{"@f_19":{"entryPoint":96,"id":19,"parameterSlots":1,"returnSlots":1},"abi_decode_available_length_t_array$_t_uint256_$dyn_memory_ptr":{"entryPoint":171,"id":null,"parameterSlots":3,"returnSlots":1},"abi_decode_t_array$_t_uint256_$dyn_memory_ptr":{"entryPoint":283,"id":null,"parameterSlots":2,"returnSlots":1},"abi_decode_t_uint256":{"entryPoint":329,"id":null,"parameterSlots":2,"returnSlots":1},"abi_decode_tuple_t_array$_t_uint256_$dyn_memory_ptr":{"entryPoint":350,"id":null,"parameterSlots":2,"returnSlots":1},"abi_encode_t_uint256_to_t_uint256_fromStack":{"entryPoint":423,"id":null,"parameterSlots":2,"returnSlots":0},"abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed":{"entryPoint":438,"id":null,"parameterSlots":2,"returnSlots":1},"allocate_memory":{"entryPoint":465,"id":null,"parameterSlots":1,"returnSlots":1},"allocate_unbounded":{"entryPoint":492,"id":null,"parameterSlots":0,"returnSlots":1},"array_allocation_size_t_array$_t_uint256_$dyn_memory_ptr":{"entryPoint":502,"id":null,"parameterSlots":1,"returnSlots":1},"checked_add_t_uint256":{"entryPoint":546,"id":null,"parameterSlots":2,"returnSlots":1},"cleanup_t_uint256":{"entryPoint":632,"id":null,"parameterSlots":1,"returnSlots":1},"finalize_allocation":{"entryPoint":642,"id":null,"parameterSlots":2,"returnSlots":0},"panic_error_0x11":{"entryPoint":691,"id":null,"parameterSlots":0,"returnSlots":0},"panic_error_0x32":{"entryPoint":738,"id":null,"parameterSlots":0,"returnSlots":0},"panic_error_0x41":{"entryPoint":785,"id":null,"parameterSlots":0,"returnSlots":0},"revert_error_1b9f4a0a5773e33b91aa01db23bf8c55fce1411167c872835e7fa00a4f17d46d":{"entryPoint":832,"id":null,"parameterSlots":0,"returnSlots":0},"revert_error_81385d8c0b31fffe14be1da910c8bd3a80be4cfa248e04f42ec0faea3132a8ef":{"entryPoint":837,"id":null,"parameterSlots":0,"returnSlots":0},"revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db":{"entryPoint":842,"id":null,"parameterSlots":0,"returnSlots":0},"revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b":{"entryPoint":847,"id":null,"parameterSlots":0,"returnSlots":0},"round_up_to_mul_of_32":{"entryPoint":852,"id":null,"parameterSlots":1,"returnSlots":1},"validator_revert_t_uint256":{"entryPoint":869,"id":null,"parameterSlots":1,"returnSlots":0}}}}}}},"sources":{"a.sol":{"id":0}}} diff --git a/test/libsolidity/SolidityExpressionCompiler.cpp b/test/libsolidity/SolidityExpressionCompiler.cpp index 2574cee9c..748718bec 100644 --- a/test/libsolidity/SolidityExpressionCompiler.cpp +++ b/test/libsolidity/SolidityExpressionCompiler.cpp @@ -162,6 +162,12 @@ bytes compileFirstExpression( context << context.functionEntryLabel(dynamic_cast( resolveDeclaration(*sourceUnit, function, resolver) )); + + context.appendMissingLowLevelFunctions(); + // NOTE: We intentionally disable optimisations for utility functions to simplfy the tests + context.appendYulUtilityFunctions({}); + BOOST_REQUIRE(context.appendYulUtilityFunctionsRan()); + BOOST_REQUIRE(context.assemblyPtr()); LinkerObject const& object = context.assemblyPtr()->assemble(); BOOST_REQUIRE(object.immutableReferences.empty()); @@ -336,7 +342,10 @@ BOOST_AUTO_TEST_CASE(arithmetic) bytes code = compileFirstExpression(sourceCode, {}, {{"test", "f", "y"}}); bytes panic = - bytes{uint8_t(Instruction::PUSH32)} + + bytes{ + uint8_t(Instruction::JUMPDEST), + uint8_t(Instruction::PUSH32) + } + fromHex("4E487B7100000000000000000000000000000000000000000000000000000000") + bytes{ uint8_t(Instruction::PUSH1), 0x0, @@ -346,7 +355,10 @@ BOOST_AUTO_TEST_CASE(arithmetic) uint8_t(Instruction::MSTORE), uint8_t(Instruction::PUSH1), 0x24, uint8_t(Instruction::PUSH1), 0x0, - uint8_t(Instruction::REVERT) + uint8_t(Instruction::REVERT), + uint8_t(Instruction::JUMPDEST), + uint8_t(Instruction::JUMP), + uint8_t(Instruction::JUMPDEST) }; bytes expectation; @@ -368,22 +380,30 @@ BOOST_AUTO_TEST_CASE(arithmetic) uint8_t(Instruction::DUP2), uint8_t(Instruction::ISZERO), uint8_t(Instruction::ISZERO), - uint8_t(Instruction::PUSH1), 0x48, - uint8_t(Instruction::JUMPI) - } + panic + bytes{ + uint8_t(Instruction::PUSH1), 0x20, + uint8_t(Instruction::JUMPI), + uint8_t(Instruction::PUSH1), 0x1f, + uint8_t(Instruction::PUSH1), 0x36, + uint8_t(Instruction::JUMP), + uint8_t(Instruction::JUMPDEST), uint8_t(Instruction::JUMPDEST), uint8_t(Instruction::MOD), uint8_t(Instruction::DUP2), uint8_t(Instruction::ISZERO), uint8_t(Instruction::ISZERO), - uint8_t(Instruction::PUSH1), 0x7e, - uint8_t(Instruction::JUMPI) - } + panic + bytes{ + uint8_t(Instruction::PUSH1), 0x2e, + uint8_t(Instruction::JUMPI), + uint8_t(Instruction::PUSH1), 0x2d, + uint8_t(Instruction::PUSH1), 0x36, + uint8_t(Instruction::JUMP), + uint8_t(Instruction::JUMPDEST), uint8_t(Instruction::JUMPDEST), uint8_t(Instruction::DIV), uint8_t(Instruction::PUSH1), 0x1, - uint8_t(Instruction::MUL) - }; + uint8_t(Instruction::MUL), + uint8_t(Instruction::PUSH1), 0x67, + uint8_t(Instruction::JUMP) + } + panic; else expectation = bytes{ uint8_t(Instruction::PUSH1), 0x1, @@ -403,21 +423,29 @@ BOOST_AUTO_TEST_CASE(arithmetic) uint8_t(Instruction::DUP2), uint8_t(Instruction::ISZERO), uint8_t(Instruction::ISZERO), - uint8_t(Instruction::PUSH1), 0x4a, - uint8_t(Instruction::JUMPI) - } + panic + bytes{ + uint8_t(Instruction::PUSH1), 0x22, + uint8_t(Instruction::JUMPI), + uint8_t(Instruction::PUSH1), 0x21, + uint8_t(Instruction::PUSH1), 0x36, + uint8_t(Instruction::JUMP), + uint8_t(Instruction::JUMPDEST), uint8_t(Instruction::JUMPDEST), uint8_t(Instruction::MOD), uint8_t(Instruction::DUP2), uint8_t(Instruction::ISZERO), uint8_t(Instruction::ISZERO), - uint8_t(Instruction::PUSH1), 0x80, - uint8_t(Instruction::JUMPI) - } + panic + bytes{ + uint8_t(Instruction::PUSH1), 0x30, + uint8_t(Instruction::JUMPI), + uint8_t(Instruction::PUSH1), 0x2f, + uint8_t(Instruction::PUSH1), 0x36, + uint8_t(Instruction::JUMP), + uint8_t(Instruction::JUMPDEST), uint8_t(Instruction::JUMPDEST), uint8_t(Instruction::DIV), - uint8_t(Instruction::MUL) - }; + uint8_t(Instruction::MUL), + uint8_t(Instruction::PUSH1), 0x67, + uint8_t(Instruction::JUMP) + } + panic; BOOST_CHECK_EQUAL_COLLECTIONS(code.begin(), code.end(), expectation.begin(), expectation.end()); } diff --git a/test/libsolidity/gasTests/dispatch_large.sol b/test/libsolidity/gasTests/dispatch_large.sol index 60c91b483..21369e6f7 100644 --- a/test/libsolidity/gasTests/dispatch_large.sol +++ b/test/libsolidity/gasTests/dispatch_large.sol @@ -24,9 +24,9 @@ contract Large { } // ---- // creation: -// codeDepositCost: 904400 -// executionCost: 942 -// totalCost: 905342 +// codeDepositCost: 640200 +// executionCost: 676 +// totalCost: 640876 // external: // a(): 2475 // b(uint256): infinite diff --git a/test/libsolidity/gasTests/dispatch_large_optimised.sol b/test/libsolidity/gasTests/dispatch_large_optimised.sol index 80dccd59e..ae38258f0 100644 --- a/test/libsolidity/gasTests/dispatch_large_optimised.sol +++ b/test/libsolidity/gasTests/dispatch_large_optimised.sol @@ -27,9 +27,9 @@ contract Large { // optimize-runs: 2 // ---- // creation: -// codeDepositCost: 256400 -// executionCost: 300 -// totalCost: 256700 +// codeDepositCost: 232800 +// executionCost: 275 +// totalCost: 233075 // external: // a(): 2283 // b(uint256): 4937 diff --git a/test/libsolidity/gasTests/dispatch_medium.sol b/test/libsolidity/gasTests/dispatch_medium.sol index ac88e828e..c76fc852e 100644 --- a/test/libsolidity/gasTests/dispatch_medium.sol +++ b/test/libsolidity/gasTests/dispatch_medium.sol @@ -11,9 +11,9 @@ contract Medium { } // ---- // creation: -// codeDepositCost: 351400 -// executionCost: 386 -// totalCost: 351786 +// codeDepositCost: 269600 +// executionCost: 312 +// totalCost: 269912 // external: // a(): 2452 // b(uint256): infinite diff --git a/test/libsolidity/gasTests/dispatch_medium_optimised.sol b/test/libsolidity/gasTests/dispatch_medium_optimised.sol index 4aba3b204..fca8d2695 100644 --- a/test/libsolidity/gasTests/dispatch_medium_optimised.sol +++ b/test/libsolidity/gasTests/dispatch_medium_optimised.sol @@ -14,9 +14,9 @@ contract Medium { // optimize-runs: 2 // ---- // creation: -// codeDepositCost: 146800 -// executionCost: 190 -// totalCost: 146990 +// codeDepositCost: 131600 +// executionCost: 177 +// totalCost: 131777 // external: // a(): 2283 // b(uint256): 4695 diff --git a/test/libsolidity/gasTests/dispatch_small.sol b/test/libsolidity/gasTests/dispatch_small.sol index 404766f79..bf66fe182 100644 --- a/test/libsolidity/gasTests/dispatch_small.sol +++ b/test/libsolidity/gasTests/dispatch_small.sol @@ -6,9 +6,9 @@ contract Small { } // ---- // creation: -// codeDepositCost: 114600 -// executionCost: 159 -// totalCost: 114759 +// codeDepositCost: 108800 +// executionCost: 153 +// totalCost: 108953 // external: // fallback: 129 // a(): 2407 diff --git a/test/libsolidity/gasTests/dispatch_small_optimised.sol b/test/libsolidity/gasTests/dispatch_small_optimised.sol index 24a815a0d..28ddf2af0 100644 --- a/test/libsolidity/gasTests/dispatch_small_optimised.sol +++ b/test/libsolidity/gasTests/dispatch_small_optimised.sol @@ -9,9 +9,9 @@ contract Small { // optimize-runs: 2 // ---- // creation: -// codeDepositCost: 62000 +// codeDepositCost: 60800 // executionCost: 111 -// totalCost: 62111 +// totalCost: 60911 // external: // fallback: 118 // a(): 2261 diff --git a/test/libsolidity/semanticTests/array/fixed_arrays_as_return_type.sol b/test/libsolidity/semanticTests/array/fixed_arrays_as_return_type.sol index 9493d0bbd..199bb1dce 100644 --- a/test/libsolidity/semanticTests/array/fixed_arrays_as_return_type.sol +++ b/test/libsolidity/semanticTests/array/fixed_arrays_as_return_type.sol @@ -22,5 +22,5 @@ contract B { // ---- // f() -> 2, 3, 4, 5, 6, 1000, 1001, 1002, 1003, 1004 // gas irOptimized: 133483 -// gas legacy: 263810 +// gas legacy: 235167 // gas legacyOptimized: 133299 diff --git a/test/libsolidity/semanticTests/array/function_array_cross_calls.sol b/test/libsolidity/semanticTests/array/function_array_cross_calls.sol index 8b2da5598..63366e934 100644 --- a/test/libsolidity/semanticTests/array/function_array_cross_calls.sol +++ b/test/libsolidity/semanticTests/array/function_array_cross_calls.sol @@ -46,5 +46,5 @@ contract C { // ---- // test() -> 5, 6, 7 // gas irOptimized: 337455 -// gas legacy: 499937 -// gas legacyOptimized: 300513 +// gas legacy: 463662 +// gas legacyOptimized: 296513 diff --git a/test/libsolidity/semanticTests/constructor/arrays_in_constructors.sol b/test/libsolidity/semanticTests/constructor/arrays_in_constructors.sol index 07f90034b..7d2f3cf78 100644 --- a/test/libsolidity/semanticTests/constructor/arrays_in_constructors.sol +++ b/test/libsolidity/semanticTests/constructor/arrays_in_constructors.sol @@ -27,5 +27,5 @@ contract Creator { // ---- // f(uint256,address[]): 7, 0x40, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 -> 7, 8 // gas irOptimized: 486618 -// gas legacy: 590826 -// gas legacyOptimized: 448624 +// gas legacy: 592626 +// gas legacyOptimized: 450224 diff --git a/test/libsolidity/semanticTests/constructor/bytes_in_constructors_packer.sol b/test/libsolidity/semanticTests/constructor/bytes_in_constructors_packer.sol index a2aafb084..7b0ecfc38 100644 --- a/test/libsolidity/semanticTests/constructor/bytes_in_constructors_packer.sol +++ b/test/libsolidity/semanticTests/constructor/bytes_in_constructors_packer.sol @@ -27,5 +27,5 @@ contract Creator { // ---- // f(uint256,bytes): 7, 0x40, 78, "abcdefghijklmnopqrstuvwxyzabcdef", "ghijklmnopqrstuvwxyzabcdefghijkl", "mnopqrstuvwxyz" -> 7, "h" // gas irOptimized: 336157 -// gas legacy: 427373 -// gas legacyOptimized: 296781 +// gas legacy: 429173 +// gas legacyOptimized: 298384 diff --git a/test/libsolidity/semanticTests/viaYul/array_storage_index_boundary_test.sol b/test/libsolidity/semanticTests/viaYul/array_storage_index_boundary_test.sol index 798133709..c2e1e925e 100644 --- a/test/libsolidity/semanticTests/viaYul/array_storage_index_boundary_test.sol +++ b/test/libsolidity/semanticTests/viaYul/array_storage_index_boundary_test.sol @@ -19,8 +19,8 @@ contract C { // test_boundary_check(uint256,uint256): 10, 10 -> FAILURE, hex"4e487b71", 0x32 // test_boundary_check(uint256,uint256): 256, 256 -> FAILURE, hex"4e487b71", 0x32 // gas irOptimized: 151436 -// gas legacy: 131815 -// gas legacyOptimized: 112039 +// gas legacy: 131830 +// gas legacyOptimized: 112054 // test_boundary_check(uint256,uint256): 256, 255 -> 0 // gas irOptimized: 153717 // gas legacy: 134149