diff --git a/libevmasm/Assembly.cpp b/libevmasm/Assembly.cpp index f524aad66..067ba7221 100644 --- a/libevmasm/Assembly.cpp +++ b/libevmasm/Assembly.cpp @@ -67,7 +67,7 @@ unsigned Assembly::codeSize(unsigned subTagSize) const ret += i.second.size(); for (AssemblyItem const& i: m_items) - ret += i.bytesRequired(tagSize, Precision::Approximate); + ret += i.bytesRequired(tagSize, m_evmVersion, Precision::Approximate); if (numberEncodingSize(ret) <= tagSize) return static_cast(ret); } @@ -383,7 +383,7 @@ std::map const& Assembly::optimiseInternal( if (_settings.runPeephole) { - PeepholeOptimiser peepOpt{m_items}; + PeepholeOptimiser peepOpt{m_items, m_evmVersion}; while (peepOpt.optimise()) { count++; diff --git a/libevmasm/AssemblyItem.cpp b/libevmasm/AssemblyItem.cpp index 6c2b673c6..b83cb2709 100644 --- a/libevmasm/AssemblyItem.cpp +++ b/libevmasm/AssemblyItem.cpp @@ -116,7 +116,7 @@ void AssemblyItem::setPushTagSubIdAndTag(size_t _subId, size_t _tag) setData(data); } -size_t AssemblyItem::bytesRequired(size_t _addressLength, Precision _precision) const +size_t AssemblyItem::bytesRequired(size_t _addressLength, langutil::EVMVersion _evmVersion, Precision _precision) const { switch (m_type) { @@ -124,7 +124,9 @@ size_t AssemblyItem::bytesRequired(size_t _addressLength, Precision _precision) case Tag: // 1 byte for the JUMPDEST return 1; case Push: - return 1 + std::max(1, numberEncodingSize(data())); + return + 1 + + std::max((_evmVersion.hasPush0() ? 0 : 1), numberEncodingSize(data())); case PushSubSize: case PushProgramSize: return 1 + 4; // worst case: a 16MB program diff --git a/libevmasm/AssemblyItem.h b/libevmasm/AssemblyItem.h index 077c1912d..34b469033 100644 --- a/libevmasm/AssemblyItem.h +++ b/libevmasm/AssemblyItem.h @@ -159,10 +159,11 @@ public: /// @returns an upper bound for the number of bytes required by this item, assuming that /// the value of a jump tag takes @a _addressLength bytes. + /// @param _evmVersion the EVM version /// @param _precision Whether to return a precise count (which involves /// counting immutable references which are only set after /// a call to `assemble()`) or an approx. count. - size_t bytesRequired(size_t _addressLength, Precision _precision = Precision::Precise) const; + size_t bytesRequired(size_t _addressLength, langutil::EVMVersion _evmVersion, Precision _precision = Precision::Precise) const; size_t arguments() const; size_t returnValues() const; size_t deposit() const { return returnValues() - arguments(); } @@ -204,11 +205,11 @@ private: mutable std::optional m_immutableOccurrences; }; -inline size_t bytesRequired(AssemblyItems const& _items, size_t _addressLength, Precision _precision = Precision::Precise) +inline size_t bytesRequired(AssemblyItems const& _items, size_t _addressLength, langutil::EVMVersion _evmVersion, Precision _precision = Precision::Precise) { size_t size = 0; for (AssemblyItem const& item: _items) - size += item.bytesRequired(_addressLength, _precision); + size += item.bytesRequired(_addressLength, _evmVersion, _precision); return size; } diff --git a/libevmasm/ConstantOptimiser.cpp b/libevmasm/ConstantOptimiser.cpp index 62dbc803b..360fb781f 100644 --- a/libevmasm/ConstantOptimiser.cpp +++ b/libevmasm/ConstantOptimiser.cpp @@ -83,7 +83,7 @@ bigint ConstantOptimisationMethod::simpleRunGas(AssemblyItems const& _items, lan bigint gas = 0; for (AssemblyItem const& item: _items) if (item.type() == Push) - gas += GasMeter::runGas(Instruction::PUSH1, _evmVersion); + gas += GasMeter::pushGas(item.data(), _evmVersion); else if (item.type() == Operation) { if (item.instruction() == Instruction::EXP) @@ -100,9 +100,9 @@ bigint ConstantOptimisationMethod::dataGas(bytes const& _data) const return bigint(GasMeter::dataGas(_data, m_params.isCreation, m_params.evmVersion)); } -size_t ConstantOptimisationMethod::bytesRequired(AssemblyItems const& _items) +size_t ConstantOptimisationMethod::bytesRequired(AssemblyItems const& _items, langutil::EVMVersion _evmVersion) { - return evmasm::bytesRequired(_items, 3, Precision::Approximate); // assume 3 byte addresses + return evmasm::bytesRequired(_items, 3, _evmVersion, Precision::Approximate); // assume 3 byte addresses } void ConstantOptimisationMethod::replaceConstants( @@ -143,7 +143,7 @@ bigint CodeCopyMethod::gasNeeded() const // Run gas: we ignore memory increase costs simpleRunGas(copyRoutine(), m_params.evmVersion) + GasCosts::copyGas, // Data gas for copy routines: Some bytes are zero, but we ignore them. - bytesRequired(copyRoutine()) * (m_params.isCreation ? GasCosts::txDataNonZeroGas(m_params.evmVersion) : GasCosts::createDataGas), + bytesRequired(copyRoutine(), m_params.evmVersion) * (m_params.isCreation ? GasCosts::txDataNonZeroGas(m_params.evmVersion) : GasCosts::createDataGas), // Data gas for data itself dataGas(toBigEndian(m_value)) ); @@ -153,37 +153,74 @@ AssemblyItems CodeCopyMethod::execute(Assembly& _assembly) const { bytes data = toBigEndian(m_value); assertThrow(data.size() == 32, OptimizerException, "Invalid number encoding."); - AssemblyItems actualCopyRoutine = copyRoutine(); - actualCopyRoutine[4] = _assembly.newData(data); - return actualCopyRoutine; + AssemblyItem newPushData = _assembly.newData(data); + return copyRoutine(&newPushData); } -AssemblyItems const& CodeCopyMethod::copyRoutine() +AssemblyItems CodeCopyMethod::copyRoutine(AssemblyItem* _pushData) const { - AssemblyItems static copyRoutine{ - // constant to be reused 3+ times - u256(0), + if (_pushData) + assertThrow(_pushData->type() == PushData, OptimizerException, "Invalid Assembly Item."); - // back up memory - // mload(0) - Instruction::DUP1, - Instruction::MLOAD, + AssemblyItem dataUsed = _pushData ? *_pushData : AssemblyItem(PushData, u256(1) << 16); - // codecopy(0, , 32) - u256(32), - AssemblyItem(PushData, u256(1) << 16), // replaced above in actualCopyRoutine[4] - Instruction::DUP4, - Instruction::CODECOPY, + // PUSH0 is cheaper than PUSHn/DUP/SWAP. + if (m_params.evmVersion.hasPush0()) + { + // This costs ~29 gas. + AssemblyItems copyRoutine{ + // back up memory + // mload(0) + u256(0), + Instruction::MLOAD, - // mload(0) - Instruction::DUP2, - Instruction::MLOAD, + // codecopy(0, , 32) + u256(32), + dataUsed, + u256(0), + Instruction::CODECOPY, - // restore original memory - Instruction::SWAP2, - Instruction::MSTORE - }; - return copyRoutine; + // mload(0) + u256(0), + Instruction::MLOAD, + + // restore original memory + // mstore(0, x) + Instruction::SWAP1, + u256(0), + Instruction::MSTORE + }; + return copyRoutine; + } + else + { + // This costs ~33 gas. + AssemblyItems copyRoutine{ + // constant to be reused 3+ times + u256(0), + + // back up memory + // mload(0) + Instruction::DUP1, + Instruction::MLOAD, + + // codecopy(0, , 32) + u256(32), + dataUsed, + Instruction::DUP4, + Instruction::CODECOPY, + + // mload(0) + Instruction::DUP2, + Instruction::MLOAD, + + // restore original memory + // mstore(0, x) + Instruction::SWAP2, + Instruction::MSTORE + }; + return copyRoutine; + } } AssemblyItems ComputeMethod::findRepresentation(u256 const& _value) @@ -323,7 +360,7 @@ bigint ComputeMethod::gasNeeded(AssemblyItems const& _routine) const return combineGas( simpleRunGas(_routine, m_params.evmVersion) + numExps * (GasCosts::expGas + GasCosts::expByteGas(m_params.evmVersion)), // Data gas for routine: Some bytes are zero, but we ignore them. - bytesRequired(_routine) * (m_params.isCreation ? GasCosts::txDataNonZeroGas(m_params.evmVersion) : GasCosts::createDataGas), + bytesRequired(_routine, m_params.evmVersion) * (m_params.isCreation ? GasCosts::txDataNonZeroGas(m_params.evmVersion) : GasCosts::createDataGas), 0 ); } diff --git a/libevmasm/ConstantOptimiser.h b/libevmasm/ConstantOptimiser.h index b491fb004..6009756d7 100644 --- a/libevmasm/ConstantOptimiser.h +++ b/libevmasm/ConstantOptimiser.h @@ -79,7 +79,7 @@ protected: static bigint simpleRunGas(AssemblyItems const& _items, langutil::EVMVersion _evmVersion); /// @returns the gas needed to store the given data literally bigint dataGas(bytes const& _data) const; - static size_t bytesRequired(AssemblyItems const& _items); + static size_t bytesRequired(AssemblyItems const& _items, langutil::EVMVersion _evmVersion); /// @returns the combined estimated gas usage taking @a m_params into account. bigint combineGas( bigint const& _runGas, @@ -123,7 +123,7 @@ public: AssemblyItems execute(Assembly& _assembly) const override; protected: - static AssemblyItems const& copyRoutine(); + AssemblyItems copyRoutine(AssemblyItem* _pushData = nullptr) const; }; /** diff --git a/libevmasm/GasMeter.cpp b/libevmasm/GasMeter.cpp index 271a6ce2d..b6c265142 100644 --- a/libevmasm/GasMeter.cpp +++ b/libevmasm/GasMeter.cpp @@ -277,6 +277,14 @@ unsigned GasMeter::runGas(Instruction _instruction, langutil::EVMVersion _evmVer return 0; } +unsigned GasMeter::pushGas(u256 _value, langutil::EVMVersion _evmVersion) +{ + return runGas( + (_evmVersion.hasPush0() && _value == u256(0)) ? Instruction::PUSH0 : Instruction::PUSH1, + _evmVersion + ); +} + u256 GasMeter::dataGas(bytes const& _data, bool _inCreation, langutil::EVMVersion _evmVersion) { bigint gas = 0; diff --git a/libevmasm/GasMeter.h b/libevmasm/GasMeter.h index ec1946644..9a7f6621f 100644 --- a/libevmasm/GasMeter.h +++ b/libevmasm/GasMeter.h @@ -223,6 +223,9 @@ public: /// change with EVM versions) static unsigned runGas(Instruction _instruction, langutil::EVMVersion _evmVersion); + /// @returns gas costs for push instructions (may change depending on EVM version) + static unsigned pushGas(u256 _value, langutil::EVMVersion _evmVersion); + /// @returns the gas cost of the supplied data, depending whether it is in creation code, or not. /// In case of @a _inCreation, the data is only sent as a transaction and is not stored, whereas /// otherwise code will be stored and have to pay "createDataGas" cost. diff --git a/libevmasm/Inliner.cpp b/libevmasm/Inliner.cpp index ded5172dd..37d47522d 100644 --- a/libevmasm/Inliner.cpp +++ b/libevmasm/Inliner.cpp @@ -59,10 +59,10 @@ u256 executionCost(RangeType const& _itemRange, langutil::EVMVersion _evmVersion } /// @returns an estimation of the code size in bytes needed for the AssemblyItems in @a _itemRange. template -uint64_t codeSize(RangeType const& _itemRange) +uint64_t codeSize(RangeType const& _itemRange, langutil::EVMVersion _evmVersion) { return ranges::accumulate(_itemRange | ranges::views::transform( - [](auto const& _item) { return _item.bytesRequired(2, Precision::Approximate); } + [&](auto const& _item) { return _item.bytesRequired(2, _evmVersion, Precision::Approximate); } ), 0u); } /// @returns the tag id, if @a _item is a PushTag or Tag into the current subassembly, std::nullopt otherwise. @@ -139,7 +139,7 @@ std::map Inliner::determineInlinableBlocks(Asse bool Inliner::shouldInlineFullFunctionBody(size_t _tag, ranges::span _block, uint64_t _pushTagCount) const { // Accumulate size of the inline candidate block in bytes (without the return jump). - uint64_t functionBodySize = codeSize(ranges::views::drop_last(_block, 1)); + uint64_t functionBodySize = codeSize(ranges::views::drop_last(_block, 1), m_evmVersion); // Use the number of push tags as approximation of the average number of calls to the function per run. uint64_t numberOfCalls = _pushTagCount; @@ -167,8 +167,8 @@ bool Inliner::shouldInlineFullFunctionBody(size_t _tag, ranges::span Inliner::shouldInline(size_t _tag, AssemblyItem cons AssemblyItem{Instruction::JUMP}, }; if ( - GasMeter::dataGas(codeSize(_block.items), m_isCreation, m_evmVersion) <= - GasMeter::dataGas(codeSize(jumpPattern), m_isCreation, m_evmVersion) + GasMeter::dataGas(codeSize(_block.items, m_evmVersion), m_isCreation, m_evmVersion) <= + GasMeter::dataGas(codeSize(jumpPattern, m_evmVersion), m_isCreation, m_evmVersion) ) return blockExit; } diff --git a/libevmasm/PeepholeOptimiser.cpp b/libevmasm/PeepholeOptimiser.cpp index e9231c0a5..6437c663d 100644 --- a/libevmasm/PeepholeOptimiser.cpp +++ b/libevmasm/PeepholeOptimiser.cpp @@ -520,7 +520,7 @@ bool PeepholeOptimiser::optimise() ); if (m_optimisedItems.size() < m_items.size() || ( m_optimisedItems.size() == m_items.size() && ( - evmasm::bytesRequired(m_optimisedItems, 3, approx) < evmasm::bytesRequired(m_items, 3, approx) || + evmasm::bytesRequired(m_optimisedItems, 3, m_evmVersion, approx) < evmasm::bytesRequired(m_items, 3, m_evmVersion, approx) || numberOfPops(m_optimisedItems) > numberOfPops(m_items) ) )) diff --git a/libevmasm/PeepholeOptimiser.h b/libevmasm/PeepholeOptimiser.h index 64ad5227f..8e3161b21 100644 --- a/libevmasm/PeepholeOptimiser.h +++ b/libevmasm/PeepholeOptimiser.h @@ -25,6 +25,8 @@ #include #include +#include + namespace solidity::evmasm { class AssemblyItem; @@ -41,7 +43,11 @@ public: class PeepholeOptimiser { public: - explicit PeepholeOptimiser(AssemblyItems& _items): m_items(_items) {} + explicit PeepholeOptimiser(AssemblyItems& _items, langutil::EVMVersion const _evmVersion): + m_items(_items), + m_evmVersion(_evmVersion) + { + } virtual ~PeepholeOptimiser() = default; bool optimise(); @@ -49,6 +55,7 @@ public: private: AssemblyItems& m_items; AssemblyItems m_optimisedItems; + langutil::EVMVersion const m_evmVersion; }; } diff --git a/libyul/backends/evm/EVMMetrics.cpp b/libyul/backends/evm/EVMMetrics.cpp index 09c6abdd1..8798bc3f6 100644 --- a/libyul/backends/evm/EVMMetrics.cpp +++ b/libyul/backends/evm/EVMMetrics.cpp @@ -87,14 +87,16 @@ void GasMeterVisitor::operator()(FunctionCall const& _funCall) void GasMeterVisitor::operator()(Literal const& _lit) { - m_runGas += evmasm::GasMeter::runGas(evmasm::Instruction::PUSH1, m_dialect.evmVersion()); - m_dataGas += - singleByteDataGas() + - evmasm::GasMeter::dataGas( - toCompactBigEndian(valueOfLiteral(_lit), 1), - m_isCreation, - m_dialect.evmVersion() - ); + m_runGas += evmasm::GasMeter::pushGas(valueOfLiteral(_lit), m_dialect.evmVersion()); + + if (!m_dialect.evmVersion().hasPush0() || valueOfLiteral(_lit) != u256(0)) + m_dataGas += + singleByteDataGas() + + evmasm::GasMeter::dataGas( + toCompactBigEndian(valueOfLiteral(_lit), 1), + m_isCreation, + m_dialect.evmVersion() + ); } void GasMeterVisitor::operator()(Identifier const&) @@ -120,5 +122,7 @@ void GasMeterVisitor::instructionCostsInternal(evmasm::Instruction _instruction) m_runGas += evmasm::GasCosts::keccak256Gas + evmasm::GasCosts::keccak256WordGas; else m_runGas += evmasm::GasMeter::runGas(_instruction, m_dialect.evmVersion()); - m_dataGas += singleByteDataGas(); + + if (_instruction != evmasm::Instruction::PUSH0) + m_dataGas += singleByteDataGas(); } diff --git a/libyul/backends/evm/StackLayoutGenerator.cpp b/libyul/backends/evm/StackLayoutGenerator.cpp index 88190b45b..923f0ee60 100644 --- a/libyul/backends/evm/StackLayoutGenerator.cpp +++ b/libyul/backends/evm/StackLayoutGenerator.cpp @@ -771,7 +771,7 @@ void StackLayoutGenerator::fillInJunk(CFG::BasicBlock const& _block, CFG::Functi yulAssert(util::contains(m_currentFunctionInfo->returnVariables, std::get(_slot))); // Strictly speaking the cost of the PUSH0 depends on the targeted EVM version, but the difference // will not matter here. - opGas += evmasm::GasMeter::runGas(evmasm::pushInstruction(0), langutil::EVMVersion());; + opGas += evmasm::GasMeter::pushGas(u256(0), langutil::EVMVersion()); } } }; diff --git a/test/cmdlineTests/debug_info_in_yul_and_evm_asm_print_all/output b/test/cmdlineTests/debug_info_in_yul_and_evm_asm_print_all/output index a232fed8f..948d841a8 100644 --- a/test/cmdlineTests/debug_info_in_yul_and_evm_asm_print_all/output +++ b/test/cmdlineTests/debug_info_in_yul_and_evm_asm_print_all/output @@ -42,6 +42,9 @@ sub_0: assembly { eq tag_3 jumpi + 0x00 + dup1 + revert tag_2: 0x00 dup1 diff --git a/test/cmdlineTests/debug_info_in_yul_and_evm_asm_print_location_only/output b/test/cmdlineTests/debug_info_in_yul_and_evm_asm_print_location_only/output index 00a6b290f..bf0bbb911 100644 --- a/test/cmdlineTests/debug_info_in_yul_and_evm_asm_print_location_only/output +++ b/test/cmdlineTests/debug_info_in_yul_and_evm_asm_print_location_only/output @@ -42,6 +42,9 @@ sub_0: assembly { eq tag_3 jumpi + 0x00 + dup1 + revert tag_2: 0x00 dup1 diff --git a/test/cmdlineTests/debug_info_in_yul_and_evm_asm_print_none/output b/test/cmdlineTests/debug_info_in_yul_and_evm_asm_print_none/output index c8715df15..5883f77e2 100644 --- a/test/cmdlineTests/debug_info_in_yul_and_evm_asm_print_none/output +++ b/test/cmdlineTests/debug_info_in_yul_and_evm_asm_print_none/output @@ -40,6 +40,9 @@ sub_0: assembly { eq tag_3 jumpi + 0x00 + dup1 + revert tag_2: 0x00 dup1 diff --git a/test/cmdlineTests/function_debug_info/output b/test/cmdlineTests/function_debug_info/output index b9ca3f3c4..fcba402b2 100644 --- a/test/cmdlineTests/function_debug_info/output +++ b/test/cmdlineTests/function_debug_info/output @@ -22,7 +22,7 @@ { "@f_14": { - "entryPoint": 124, + "entryPoint": 127, "id": 14, "parameterSlots": 2, "returnSlots": 1 @@ -35,13 +35,13 @@ }, "abi_decode_tuple_t_array$_t_uint256_$dyn_calldata_ptr": { - "entryPoint": 158, + "entryPoint": 161, "parameterSlots": 2, "returnSlots": 2 }, "abi_decode_tuple_t_uint256": { - "entryPoint": 269, + "entryPoint": 272, "parameterSlots": 2, "returnSlots": 1 }, @@ -52,7 +52,7 @@ }, "panic_error_0x32": { - "entryPoint": 292, + "entryPoint": 295, "parameterSlots": 0, "returnSlots": 0 } diff --git a/test/cmdlineTests/optimize_full_storage_write/output b/test/cmdlineTests/optimize_full_storage_write/output index 1a7322030..00f2c75f3 100644 --- a/test/cmdlineTests/optimize_full_storage_write/output +++ b/test/cmdlineTests/optimize_full_storage_write/output @@ -42,6 +42,9 @@ sub_0: assembly { eq tag_3 jumpi + 0x00 + dup1 + revert tag_2: 0x00 dup1 diff --git a/test/cmdlineTests/optimizer_BlockDeDuplicator/output b/test/cmdlineTests/optimizer_BlockDeDuplicator/output index ddf17bdae..ebcf08196 100644 --- a/test/cmdlineTests/optimizer_BlockDeDuplicator/output +++ b/test/cmdlineTests/optimizer_BlockDeDuplicator/output @@ -73,6 +73,9 @@ sub_0: assembly { eq tag_3 jumpi + 0x00 + dup1 + revert tag_2: 0x00 dup1 diff --git a/test/cmdlineTests/optimizer_inliner_add/output b/test/cmdlineTests/optimizer_inliner_add/output index 648d20fe8..7c5df94bc 100644 --- a/test/cmdlineTests/optimizer_inliner_add/output +++ b/test/cmdlineTests/optimizer_inliner_add/output @@ -42,6 +42,9 @@ sub_0: assembly { eq tag_3 jumpi + 0x00 + dup1 + revert tag_2: 0x00 dup1 diff --git a/test/cmdlineTests/optimizer_inliner_call_from_constructor/output b/test/cmdlineTests/optimizer_inliner_call_from_constructor/output index 86c09e27e..88828ed16 100644 --- a/test/cmdlineTests/optimizer_inliner_call_from_constructor/output +++ b/test/cmdlineTests/optimizer_inliner_call_from_constructor/output @@ -50,6 +50,9 @@ sub_0: assembly { eq tag_3 jumpi + 0x00 + dup1 + revert tag_2: 0x00 dup1 diff --git a/test/cmdlineTests/optimizer_inliner_dynamic_reference/output b/test/cmdlineTests/optimizer_inliner_dynamic_reference/output index 2ddef4d76..ad5291329 100644 --- a/test/cmdlineTests/optimizer_inliner_dynamic_reference/output +++ b/test/cmdlineTests/optimizer_inliner_dynamic_reference/output @@ -52,6 +52,9 @@ sub_0: assembly { eq tag_5 jumpi + 0x00 + dup1 + revert tag_2: 0x00 dup1 diff --git a/test/cmdlineTests/optimizer_inliner_dynamic_reference_constructor/output b/test/cmdlineTests/optimizer_inliner_dynamic_reference_constructor/output index edc93c0be..a733c7ee4 100644 --- a/test/cmdlineTests/optimizer_inliner_dynamic_reference_constructor/output +++ b/test/cmdlineTests/optimizer_inliner_dynamic_reference_constructor/output @@ -74,6 +74,9 @@ sub_0: assembly { eq tag_4 jumpi + 0x00 + dup1 + revert tag_2: 0x00 dup1 diff --git a/test/cmdlineTests/optimizer_inliner_inc/output b/test/cmdlineTests/optimizer_inliner_inc/output index 04f5f745a..eaf253ef2 100644 --- a/test/cmdlineTests/optimizer_inliner_inc/output +++ b/test/cmdlineTests/optimizer_inliner_inc/output @@ -42,6 +42,9 @@ sub_0: assembly { eq tag_3 jumpi + 0x00 + dup1 + revert tag_2: 0x00 dup1 diff --git a/test/cmdlineTests/optimizer_inliner_multireturn/output b/test/cmdlineTests/optimizer_inliner_multireturn/output index ca7b0abdf..44e6a9cf2 100644 --- a/test/cmdlineTests/optimizer_inliner_multireturn/output +++ b/test/cmdlineTests/optimizer_inliner_multireturn/output @@ -42,6 +42,9 @@ sub_0: assembly { eq tag_3 jumpi + 0x00 + dup1 + revert tag_2: 0x00 dup1 diff --git a/test/cmdlineTests/standard_debug_info_in_yul_and_evm_asm_print_all/output.json b/test/cmdlineTests/standard_debug_info_in_yul_and_evm_asm_print_all/output.json index ee958b55b..83a08a3a6 100644 --- a/test/cmdlineTests/standard_debug_info_in_yul_and_evm_asm_print_all/output.json +++ b/test/cmdlineTests/standard_debug_info_in_yul_and_evm_asm_print_all/output.json @@ -48,6 +48,9 @@ sub_0: assembly { eq tag_3 jumpi + 0x00 + dup1 + revert tag_2: 0x00 dup1 diff --git a/test/cmdlineTests/standard_debug_info_in_yul_and_evm_asm_print_location_only/output.json b/test/cmdlineTests/standard_debug_info_in_yul_and_evm_asm_print_location_only/output.json index 007b7fc62..a41696df6 100644 --- a/test/cmdlineTests/standard_debug_info_in_yul_and_evm_asm_print_location_only/output.json +++ b/test/cmdlineTests/standard_debug_info_in_yul_and_evm_asm_print_location_only/output.json @@ -48,6 +48,9 @@ sub_0: assembly { eq tag_3 jumpi + 0x00 + dup1 + revert tag_2: 0x00 dup1 diff --git a/test/cmdlineTests/standard_debug_info_in_yul_and_evm_asm_print_none/output.json b/test/cmdlineTests/standard_debug_info_in_yul_and_evm_asm_print_none/output.json index 884da9eb9..2ee50c6f3 100644 --- a/test/cmdlineTests/standard_debug_info_in_yul_and_evm_asm_print_none/output.json +++ b/test/cmdlineTests/standard_debug_info_in_yul_and_evm_asm_print_none/output.json @@ -46,6 +46,9 @@ sub_0: assembly { eq tag_3 jumpi + 0x00 + dup1 + revert tag_2: 0x00 dup1 diff --git a/test/libevmasm/Optimiser.cpp b/test/libevmasm/Optimiser.cpp index 6f1a13759..a3023345b 100644 --- a/test/libevmasm/Optimiser.cpp +++ b/test/libevmasm/Optimiser.cpp @@ -1001,7 +1001,7 @@ BOOST_AUTO_TEST_CASE(clear_unreachable_code) AssemblyItem(PushTag, 1), Instruction::JUMP }; - PeepholeOptimiser peepOpt(items); + PeepholeOptimiser peepOpt(items, solidity::test::CommonOptions::get().evmVersion()); BOOST_REQUIRE(peepOpt.optimise()); BOOST_CHECK_EQUAL_COLLECTIONS( items.begin(), items.end(), @@ -1027,7 +1027,7 @@ BOOST_AUTO_TEST_CASE(peephole_double_push) u256(4), u256(5) }; - PeepholeOptimiser peepOpt(items); + PeepholeOptimiser peepOpt(items, solidity::test::CommonOptions::get().evmVersion()); BOOST_REQUIRE(peepOpt.optimise()); BOOST_CHECK_EQUAL_COLLECTIONS( items.begin(), items.end(), @@ -1043,7 +1043,7 @@ BOOST_AUTO_TEST_CASE(peephole_pop_calldatasize) Instruction::LT, Instruction::POP }; - PeepholeOptimiser peepOpt(items); + PeepholeOptimiser peepOpt(items, solidity::test::CommonOptions::get().evmVersion()); for (size_t i = 0; i < 3; i++) BOOST_CHECK(peepOpt.optimise()); BOOST_CHECK(items.empty()); @@ -1076,7 +1076,7 @@ BOOST_AUTO_TEST_CASE(peephole_commutative_swap1) u256(4), u256(5) }; - PeepholeOptimiser peepOpt(items); + PeepholeOptimiser peepOpt(items, solidity::test::CommonOptions::get().evmVersion()); BOOST_REQUIRE(peepOpt.optimise()); BOOST_CHECK_EQUAL_COLLECTIONS( items.begin(), items.end(), @@ -1114,7 +1114,7 @@ BOOST_AUTO_TEST_CASE(peephole_noncommutative_swap1) u256(4), u256(5) }; - PeepholeOptimiser peepOpt(items); + PeepholeOptimiser peepOpt(items, solidity::test::CommonOptions::get().evmVersion()); BOOST_REQUIRE(!peepOpt.optimise()); BOOST_CHECK_EQUAL_COLLECTIONS( items.begin(), items.end(), @@ -1149,7 +1149,7 @@ BOOST_AUTO_TEST_CASE(peephole_swap_comparison) u256(4), u256(5) }; - PeepholeOptimiser peepOpt(items); + PeepholeOptimiser peepOpt(items, solidity::test::CommonOptions::get().evmVersion()); BOOST_REQUIRE(peepOpt.optimise()); BOOST_CHECK_EQUAL_COLLECTIONS( items.begin(), items.end(), @@ -1175,7 +1175,7 @@ BOOST_AUTO_TEST_CASE(peephole_truthy_and) AssemblyItem(PushTag, 1), Instruction::JUMPI }; - PeepholeOptimiser peepOpt(items); + PeepholeOptimiser peepOpt(items, solidity::test::CommonOptions::get().evmVersion()); BOOST_REQUIRE(peepOpt.optimise()); BOOST_CHECK_EQUAL_COLLECTIONS( items.begin(), items.end(), @@ -1208,7 +1208,7 @@ BOOST_AUTO_TEST_CASE(peephole_iszero_iszero_jumpi) u256(0x20), Instruction::RETURN }; - PeepholeOptimiser peepOpt(items); + PeepholeOptimiser peepOpt(items, solidity::test::CommonOptions::get().evmVersion()); BOOST_REQUIRE(peepOpt.optimise()); BOOST_CHECK_EQUAL_COLLECTIONS( items.begin(), items.end(), @@ -1878,8 +1878,9 @@ BOOST_AUTO_TEST_CASE(inliner_revert_increased_datagas) { // Inlining this would increase data gas (5 bytes v/s 4 bytes), therefore, skipped. AssemblyItems items{ - AssemblyItem(PushTag, 1), - Instruction::JUMP, + u256(0), + u256(0), + Instruction::REVERT, AssemblyItem(Tag, 1), u256(0), u256(0), diff --git a/test/libsolidity/Assembly.cpp b/test/libsolidity/Assembly.cpp index f12c12ca9..8baa335c5 100644 --- a/test/libsolidity/Assembly.cpp +++ b/test/libsolidity/Assembly.cpp @@ -169,13 +169,14 @@ BOOST_AUTO_TEST_CASE(location_test) AssemblyItems items = compileContract(make_shared(sourceCode, "")); shared_ptr sourceName = make_shared(); bool hasShifts = solidity::test::CommonOptions::get().evmVersion().hasBitwiseShifting(); + bool hasPush0 = solidity::test::CommonOptions::get().evmVersion().hasPush0(); auto codegenCharStream = make_shared("", "--CODEGEN--"); vector locations; if (solidity::test::CommonOptions::get().optimize) locations = - vector(31, SourceLocation{23, 103, sourceName}) + + vector(hasPush0 ? 34 : 31, SourceLocation{23, 103, sourceName}) + vector(1, SourceLocation{41, 100, sourceName}) + vector(1, SourceLocation{93, 95, sourceName}) + vector(15, SourceLocation{41, 100, sourceName}); diff --git a/test/libsolidity/GasCosts.cpp b/test/libsolidity/GasCosts.cpp index 0f280c9a0..2b8f45775 100644 --- a/test/libsolidity/GasCosts.cpp +++ b/test/libsolidity/GasCosts.cpp @@ -116,7 +116,7 @@ BOOST_AUTO_TEST_CASE(string_storage) CHECK_DEPLOY_GAS(0, 97697, evmVersion); // Shanghai is cheaper due to `push0` else - CHECK_DEPLOY_GAS(0, 97071, evmVersion); + CHECK_DEPLOY_GAS(0, 97719, evmVersion); } else { @@ -134,7 +134,7 @@ BOOST_AUTO_TEST_CASE(string_storage) else if (evmVersion < EVMVersion::shanghai()) CHECK_DEPLOY_GAS(114077, 96461, evmVersion); else - CHECK_DEPLOY_GAS(114077, 95835, evmVersion); + CHECK_DEPLOY_GAS(114077, 96483, evmVersion); if (evmVersion >= EVMVersion::byzantium()) { diff --git a/test/libsolidity/gasTests/abiv2_optimised.sol b/test/libsolidity/gasTests/abiv2_optimised.sol index 608d1c8ba..201921b73 100644 --- a/test/libsolidity/gasTests/abiv2_optimised.sol +++ b/test/libsolidity/gasTests/abiv2_optimised.sol @@ -17,9 +17,9 @@ contract C { // optimize-yul: true // ---- // creation: -// codeDepositCost: 638600 +// codeDepositCost: 639200 // executionCost: 668 -// totalCost: 639268 +// totalCost: 639868 // external: // a(): 2283 // b(uint256): 4649 diff --git a/test/libsolidity/gasTests/dispatch_large_optimised.sol b/test/libsolidity/gasTests/dispatch_large_optimised.sol index 83e55c1a9..d7fd24205 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: 224600 +// codeDepositCost: 225200 // executionCost: 267 -// totalCost: 224867 +// totalCost: 225467 // external: // a(): 2281 // b(uint256): 4934 diff --git a/test/libsolidity/gasTests/dispatch_medium_optimised.sol b/test/libsolidity/gasTests/dispatch_medium_optimised.sol index e921fcf12..32987899e 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: 126000 +// codeDepositCost: 126600 // executionCost: 169 -// totalCost: 126169 +// totalCost: 126769 // external: // a(): 2281 // b(uint256): 4692 diff --git a/test/libsolidity/gasTests/exp_optimized.sol b/test/libsolidity/gasTests/exp_optimized.sol index 982fcd28f..22c0590b5 100644 --- a/test/libsolidity/gasTests/exp_optimized.sol +++ b/test/libsolidity/gasTests/exp_optimized.sol @@ -19,9 +19,9 @@ contract C { // optimize-yul: true // ---- // creation: -// codeDepositCost: 35800 +// codeDepositCost: 36400 // executionCost: 85 -// totalCost: 35885 +// totalCost: 36485 // external: // exp_neg_one(uint256): 1914 // exp_one(uint256): 1868 diff --git a/test/libsolidity/gasTests/storage_costs.sol b/test/libsolidity/gasTests/storage_costs.sol index afb442ed7..bd7f07ec9 100644 --- a/test/libsolidity/gasTests/storage_costs.sol +++ b/test/libsolidity/gasTests/storage_costs.sol @@ -15,9 +15,9 @@ contract C { // optimize-yul: true // ---- // creation: -// codeDepositCost: 25600 -// executionCost: 73 -// totalCost: 25673 +// codeDepositCost: 26200 +// executionCost: 79 +// totalCost: 26279 // external: // readX(): 2288 // resetX(): 5114 diff --git a/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_v2.sol b/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_v2.sol index 5e50d5e9a..753a39a68 100644 --- a/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_v2.sol +++ b/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_v2.sol @@ -51,5 +51,5 @@ contract C { // f3() -> 0x20, 0xa0, 0x1, 0x60, 0x2, 0x3, "abc" // f4() -> 0x20, 0x160, 0x1, 0x80, 0xc0, 0x2, 0x3, "abc", 0x7, 0x40, 0x2, 0x2, 0x3 // gas irOptimized: 112630 -// gas legacy: 114794 +// gas legacy: 114793 // gas legacyOptimized: 112572 diff --git a/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_v2_in_function_inherited_in_v1_contract.sol b/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_v2_in_function_inherited_in_v1_contract.sol index 07e517b2d..883a05252 100644 --- a/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_v2_in_function_inherited_in_v1_contract.sol +++ b/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_v2_in_function_inherited_in_v1_contract.sol @@ -32,4 +32,4 @@ contract C is B { // test() -> 77 // gas irOptimized: 110325 // gas legacy: 151866 -// gas legacyOptimized: 110359 +// gas legacyOptimized: 110959 diff --git a/test/libsolidity/semanticTests/array/arrays_complex_from_and_to_storage.sol b/test/libsolidity/semanticTests/array/arrays_complex_from_and_to_storage.sol index 715e8a589..f63df15e2 100644 --- a/test/libsolidity/semanticTests/array/arrays_complex_from_and_to_storage.sol +++ b/test/libsolidity/semanticTests/array/arrays_complex_from_and_to_storage.sol @@ -12,7 +12,7 @@ contract Test { } // ---- // set(uint24[3][]): 0x20, 0x06, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12 -> 0x06 -// gas irOptimized: 186554 +// gas irOptimized: 186551 // gas legacy: 211054 // gas legacyOptimized: 206042 // data(uint256,uint256): 0x02, 0x02 -> 0x09 diff --git a/test/libsolidity/semanticTests/array/byte_array_transitional_2.sol b/test/libsolidity/semanticTests/array/byte_array_transitional_2.sol index ae3d23a63..c7556ae86 100644 --- a/test/libsolidity/semanticTests/array/byte_array_transitional_2.sol +++ b/test/libsolidity/semanticTests/array/byte_array_transitional_2.sol @@ -17,6 +17,6 @@ contract c { } // ---- // test() -> 0 -// gas irOptimized: 125058 +// gas irOptimized: 125123 // gas legacy: 150372 // gas legacyOptimized: 146391 diff --git a/test/libsolidity/semanticTests/array/constant_var_as_array_length.sol b/test/libsolidity/semanticTests/array/constant_var_as_array_length.sol index ca65f0706..fffc2b960 100644 --- a/test/libsolidity/semanticTests/array/constant_var_as_array_length.sol +++ b/test/libsolidity/semanticTests/array/constant_var_as_array_length.sol @@ -10,7 +10,7 @@ contract C { // constructor(): 1, 2, 3 -> // gas irOptimized: 139656 // gas legacy: 180517 -// gas legacyOptimized: 150462 +// gas legacyOptimized: 151110 // a(uint256): 0 -> 1 // a(uint256): 1 -> 2 // a(uint256): 2 -> 3 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_cleanup_uint40.sol b/test/libsolidity/semanticTests/array/copying/array_copy_cleanup_uint40.sol index a06ee7f89..3c3fbf1e1 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_cleanup_uint40.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_cleanup_uint40.sol @@ -46,6 +46,6 @@ contract C { } // ---- // f() -> true -// gas irOptimized: 117261 -// gas legacy: 124660 +// gas irOptimized: 117206 +// gas legacy: 124659 // gas legacyOptimized: 122801 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_different_packing.sol b/test/libsolidity/semanticTests/array/copying/array_copy_different_packing.sol index f039ce0be..2f82a03bd 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_different_packing.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_different_packing.sol @@ -18,6 +18,6 @@ contract c { } // ---- // test() -> 0x01000000000000000000000000000000000000000000000000, 0x02000000000000000000000000000000000000000000000000, 0x03000000000000000000000000000000000000000000000000, 0x04000000000000000000000000000000000000000000000000, 0x05000000000000000000000000000000000000000000000000 -// gas irOptimized: 208053 +// gas irOptimized: 207993 // gas legacy: 221769 // gas legacyOptimized: 220611 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_different_base.sol b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_different_base.sol index 911653b37..7f6a506ea 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_different_base.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_different_base.sol @@ -18,5 +18,5 @@ contract c { // ---- // test() -> 5, 4 // gas irOptimized: 205045 -// gas legacy: 213863 +// gas legacy: 213864 // gas legacyOptimized: 212902 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_different_base_nested.sol b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_different_base_nested.sol index f75338bb7..5d7861b11 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_different_base_nested.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_different_base_nested.sol @@ -22,5 +22,5 @@ contract c { // ---- // test() -> 3, 4 // gas irOptimized: 169586 -// gas legacy: 175424 +// gas legacy: 175419 // gas legacyOptimized: 172535 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_dyn_dyn.sol b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_dyn_dyn.sol index 99dd1ca93..f4e113518 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_dyn_dyn.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_dyn_dyn.sol @@ -15,7 +15,7 @@ contract c { // ---- // setData1(uint256,uint256,uint256): 10, 5, 4 -> // copyStorageStorage() -> -// gas irOptimized: 111348 +// gas irOptimized: 111345 // gas legacy: 109272 // gas legacyOptimized: 109262 // getData2(uint256): 5 -> 10, 4 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_dynamic_dynamic.sol b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_dynamic_dynamic.sol index 30173409e..eb62ef669 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_dynamic_dynamic.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_dynamic_dynamic.sol @@ -18,5 +18,5 @@ contract c { // ---- // test() -> 5, 4 // gas irOptimized: 252929 -// gas legacy: 250892 +// gas legacy: 250893 // gas legacyOptimized: 250046 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_storage_to_memory_nested.sol b/test/libsolidity/semanticTests/array/copying/array_copy_storage_to_memory_nested.sol index 6bd31ca5a..726e5ead9 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_storage_to_memory_nested.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_storage_to_memory_nested.sol @@ -15,6 +15,6 @@ contract C { } // ---- // f() -> 0x20, 2, 0x40, 0xa0, 2, 0, 1, 2, 2, 3 -// gas irOptimized: 161624 -// gas legacy: 162203 +// gas irOptimized: 161627 +// gas legacy: 162201 // gas legacyOptimized: 159934 diff --git a/test/libsolidity/semanticTests/array/copying/array_elements_to_mapping.sol b/test/libsolidity/semanticTests/array/copying/array_elements_to_mapping.sol index b1e8659be..3b0e5471e 100644 --- a/test/libsolidity/semanticTests/array/copying/array_elements_to_mapping.sol +++ b/test/libsolidity/semanticTests/array/copying/array_elements_to_mapping.sol @@ -53,8 +53,8 @@ contract C { // ---- // from_storage() -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14 // gas irOptimized: 150004 -// gas legacy: 150745 -// gas legacyOptimized: 148678 +// gas legacy: 150741 +// gas legacyOptimized: 148672 // from_storage_ptr() -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14 // from_memory() -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14 // from_calldata(uint8[][]): 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14 -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14 diff --git a/test/libsolidity/semanticTests/array/copying/array_nested_memory_to_storage.sol b/test/libsolidity/semanticTests/array/copying/array_nested_memory_to_storage.sol index 1bc50ab80..25a16f79a 100644 --- a/test/libsolidity/semanticTests/array/copying/array_nested_memory_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/array_nested_memory_to_storage.sol @@ -38,12 +38,12 @@ contract Test { } // ---- // test() -> 24 -// gas irOptimized: 226666 +// gas irOptimized: 226652 // gas legacy: 227084 // gas legacyOptimized: 226529 // test1() -> 3 // test2() -> 6 // test3() -> 24 -// gas irOptimized: 141223 +// gas irOptimized: 141217 // gas legacy: 142238 // gas legacyOptimized: 141365 diff --git a/test/libsolidity/semanticTests/array/copying/array_to_mapping.sol b/test/libsolidity/semanticTests/array/copying/array_to_mapping.sol index 50ea19a1e..f61df7170 100644 --- a/test/libsolidity/semanticTests/array/copying/array_to_mapping.sol +++ b/test/libsolidity/semanticTests/array/copying/array_to_mapping.sol @@ -37,8 +37,8 @@ contract C { } // ---- // from_storage() -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14 -// gas irOptimized: 147871 -// gas legacy: 148896 -// gas legacyOptimized: 146901 +// gas irOptimized: 147862 +// gas legacy: 148894 +// gas legacyOptimized: 146895 // from_storage_ptr() -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14 // from_memory() -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14 diff --git a/test/libsolidity/semanticTests/array/copying/bytes_storage_to_storage.sol b/test/libsolidity/semanticTests/array/copying/bytes_storage_to_storage.sol index 4b91f666c..83451466f 100644 --- a/test/libsolidity/semanticTests/array/copying/bytes_storage_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/bytes_storage_to_storage.sol @@ -21,21 +21,21 @@ contract c { // gas legacy: 123948 // gas legacyOptimized: 118948 // f(uint256): 32 -> 0x20, 0x20, 1780731860627700044960722568376592200742329637303199754547598369979440671 -// gas irOptimized: 124049 +// gas irOptimized: 123843 // gas legacy: 140362 // gas legacyOptimized: 135386 // f(uint256): 33 -> 0x20, 33, 1780731860627700044960722568376592200742329637303199754547598369979440671, 0x2000000000000000000000000000000000000000000000000000000000000000 -// gas irOptimized: 130665 +// gas irOptimized: 130444 // gas legacy: 147916 // gas legacyOptimized: 142278 // f(uint256): 63 -> 0x20, 0x3f, 1780731860627700044960722568376592200742329637303199754547598369979440671, 14532552714582660066924456880521368950258152170031413196862950297402215316992 -// gas irOptimized: 139545 +// gas irOptimized: 139144 // gas legacy: 171136 // gas legacyOptimized: 161538 // f(uint256): 12 -> 0x20, 0x0c, 0x0102030405060708090a0b0000000000000000000000000000000000000000 // gas legacy: 59345 // gas legacyOptimized: 57279 // f(uint256): 129 -> 0x20, 0x81, 1780731860627700044960722568376592200742329637303199754547598369979440671, 0x202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f, 29063324697304692433803953038474361308315562010425523193971352996434451193439, 0x606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f, -57896044618658097711785492504343953926634992332820282019728792003956564819968 -// gas irOptimized: 442421 +// gas irOptimized: 441621 // gas legacy: 505021 // gas legacyOptimized: 486997 diff --git a/test/libsolidity/semanticTests/array/copying/calldata_array_dynamic_to_storage.sol b/test/libsolidity/semanticTests/array/copying/calldata_array_dynamic_to_storage.sol index 2dfde7afa..7c36a6fe0 100644 --- a/test/libsolidity/semanticTests/array/copying/calldata_array_dynamic_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/calldata_array_dynamic_to_storage.sol @@ -10,5 +10,5 @@ contract C { // ---- // f(uint256[]): 0x20, 0x03, 0x1, 0x2, 0x3 -> 0x1 // gas irOptimized: 110962 -// gas legacy: 111551 +// gas legacy: 111550 // gas legacyOptimized: 111339 diff --git a/test/libsolidity/semanticTests/array/copying/cleanup_during_multi_element_per_slot_copy.sol b/test/libsolidity/semanticTests/array/copying/cleanup_during_multi_element_per_slot_copy.sol index d2361dac5..7d3696497 100644 --- a/test/libsolidity/semanticTests/array/copying/cleanup_during_multi_element_per_slot_copy.sol +++ b/test/libsolidity/semanticTests/array/copying/cleanup_during_multi_element_per_slot_copy.sol @@ -18,5 +18,5 @@ contract C { // constructor() // gas irOptimized: 226349 // gas legacy: 215757 -// gas legacyOptimized: 181760 +// gas legacyOptimized: 182408 // f() -> 0 diff --git a/test/libsolidity/semanticTests/array/copying/copy_byte_array_in_struct_to_storage.sol b/test/libsolidity/semanticTests/array/copying/copy_byte_array_in_struct_to_storage.sol index fdcc18835..95db1d8e9 100644 --- a/test/libsolidity/semanticTests/array/copying/copy_byte_array_in_struct_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/copy_byte_array_in_struct_to_storage.sol @@ -35,11 +35,11 @@ contract C { } // ---- // f() -> 0x40, 0x80, 6, 0x6162636465660000000000000000000000000000000000000000000000000000, 0x49, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738390000000000000000000000000000000000000000000000 -// gas irOptimized: 179734 +// gas irOptimized: 179731 // gas legacy: 181001 // gas legacyOptimized: 180018 // g() -> 0x40, 0xc0, 0x49, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738390000000000000000000000000000000000000000000000, 0x11, 0x3132333435363738393233343536373839000000000000000000000000000000 -// gas irOptimized: 106663 +// gas irOptimized: 106657 // gas legacy: 109720 // gas legacyOptimized: 106932 // h() -> 0x40, 0x60, 0x00, 0x00 diff --git a/test/libsolidity/semanticTests/array/copying/copy_function_internal_storage_array.sol b/test/libsolidity/semanticTests/array/copying/copy_function_internal_storage_array.sol index 8ee78ab9b..30120c8d2 100644 --- a/test/libsolidity/semanticTests/array/copying/copy_function_internal_storage_array.sol +++ b/test/libsolidity/semanticTests/array/copying/copy_function_internal_storage_array.sol @@ -15,6 +15,6 @@ contract C { } // ---- // test() -> 7 -// gas irOptimized: 122456 +// gas irOptimized: 122442 // gas legacy: 205176 // gas legacyOptimized: 204971 diff --git a/test/libsolidity/semanticTests/array/copying/copy_removes_bytes_data.sol b/test/libsolidity/semanticTests/array/copying/copy_removes_bytes_data.sol index 752dd6494..e652597ef 100644 --- a/test/libsolidity/semanticTests/array/copying/copy_removes_bytes_data.sol +++ b/test/libsolidity/semanticTests/array/copying/copy_removes_bytes_data.sol @@ -7,7 +7,7 @@ contract c { } // ---- // set(): 1, 2, 3, 4, 5 -> true -// gas irOptimized: 177375 +// gas irOptimized: 177372 // gas legacy: 177954 // gas legacyOptimized: 177553 // storageEmpty -> 0 diff --git a/test/libsolidity/semanticTests/array/copying/copying_bytes_multiassign.sol b/test/libsolidity/semanticTests/array/copying/copying_bytes_multiassign.sol index 4bf021094..dba523731 100644 --- a/test/libsolidity/semanticTests/array/copying/copying_bytes_multiassign.sol +++ b/test/libsolidity/semanticTests/array/copying/copying_bytes_multiassign.sol @@ -18,7 +18,7 @@ contract sender { } // ---- // (): 7 -> -// gas irOptimized: 110831 +// gas irOptimized: 110822 // gas legacy: 111388 // gas legacyOptimized: 111070 // val() -> 0 diff --git a/test/libsolidity/semanticTests/array/copying/function_type_array_to_storage.sol b/test/libsolidity/semanticTests/array/copying/function_type_array_to_storage.sol index a357147c5..c5ecb8882 100644 --- a/test/libsolidity/semanticTests/array/copying/function_type_array_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/function_type_array_to_storage.sol @@ -46,11 +46,11 @@ contract C { } // ---- // test() -> 0x20, 0x14, "[a called][b called]" -// gas irOptimized: 116633 +// gas irOptimized: 116622 // gas legacy: 118936 // gas legacyOptimized: 116975 // test2() -> 0x20, 0x14, "[b called][a called]" // test3() -> 0x20, 0x14, "[b called][a called]" -// gas irOptimized: 103243 +// gas irOptimized: 103238 // gas legacy: 102745 // gas legacyOptimized: 101669 diff --git a/test/libsolidity/semanticTests/array/copying/storage_memory_packed_dyn.sol b/test/libsolidity/semanticTests/array/copying/storage_memory_packed_dyn.sol index bfda8d7af..05335827b 100644 --- a/test/libsolidity/semanticTests/array/copying/storage_memory_packed_dyn.sol +++ b/test/libsolidity/semanticTests/array/copying/storage_memory_packed_dyn.sol @@ -14,5 +14,5 @@ contract C { // ---- // f() -> 2, 3, 4 // gas irOptimized: 109698 -// gas legacy: 126129 +// gas legacy: 126128 // gas legacyOptimized: 120622 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 79c0f8fbf..a5162db85 100644 --- a/test/libsolidity/semanticTests/array/fixed_arrays_as_return_type.sol +++ b/test/libsolidity/semanticTests/array/fixed_arrays_as_return_type.sol @@ -20,4 +20,4 @@ contract B { // f() -> 2, 3, 4, 5, 6, 1000, 1001, 1002, 1003, 1004 // gas irOptimized: 114204 // gas legacy: 230001 -// gas legacyOptimized: 130637 +// gas legacyOptimized: 131242 diff --git a/test/libsolidity/semanticTests/array/fixed_arrays_in_constructors.sol b/test/libsolidity/semanticTests/array/fixed_arrays_in_constructors.sol index ac11d779a..f6401f984 100644 --- a/test/libsolidity/semanticTests/array/fixed_arrays_in_constructors.sol +++ b/test/libsolidity/semanticTests/array/fixed_arrays_in_constructors.sol @@ -11,6 +11,6 @@ contract Creator { // constructor(): 1, 2, 3, 4 -> // gas irOptimized: 126363 // gas legacy: 174186 -// gas legacyOptimized: 128709 +// gas legacyOptimized: 129357 // r() -> 4 // ch() -> 3 diff --git a/test/libsolidity/semanticTests/array/function_array_cross_calls.sol b/test/libsolidity/semanticTests/array/function_array_cross_calls.sol index e91608966..d7b2b610f 100644 --- a/test/libsolidity/semanticTests/array/function_array_cross_calls.sol +++ b/test/libsolidity/semanticTests/array/function_array_cross_calls.sol @@ -44,4 +44,4 @@ contract C { // test() -> 5, 6, 7 // gas irOptimized: 256077 // gas legacy: 441556 -// gas legacyOptimized: 279321 +// gas legacyOptimized: 279921 diff --git a/test/libsolidity/semanticTests/array/invalid_encoding_for_storage_byte_array.sol b/test/libsolidity/semanticTests/array/invalid_encoding_for_storage_byte_array.sol index 4d8422ecd..cc628dcc2 100644 --- a/test/libsolidity/semanticTests/array/invalid_encoding_for_storage_byte_array.sol +++ b/test/libsolidity/semanticTests/array/invalid_encoding_for_storage_byte_array.sol @@ -40,7 +40,7 @@ contract C { // copyFromStorageShort() // x() -> 0x20, 3, 0x6162630000000000000000000000000000000000000000000000000000000000 // copyFromStorageLong() -// gas irOptimized: 121104 +// gas irOptimized: 121092 // gas legacy: 121904 // gas legacyOptimized: 121400 // x() -> 0x20, 0x25, 0x3132333435363738393031323334353637383930313233343536373839303132, 0x3334353637000000000000000000000000000000000000000000000000000000 diff --git a/test/libsolidity/semanticTests/array/pop/byte_array_pop_long_storage_empty.sol b/test/libsolidity/semanticTests/array/pop/byte_array_pop_long_storage_empty.sol index a3ba9d4d2..31ff1a33c 100644 --- a/test/libsolidity/semanticTests/array/pop/byte_array_pop_long_storage_empty.sol +++ b/test/libsolidity/semanticTests/array/pop/byte_array_pop_long_storage_empty.sol @@ -16,7 +16,7 @@ contract c { } // ---- // test() -> true -// gas irOptimized: 140154 +// gas irOptimized: 139984 // gas legacy: 178397 // gas legacyOptimized: 163832 // storageEmpty -> 1 diff --git a/test/libsolidity/semanticTests/array/pop/byte_array_pop_long_storage_empty_garbage_ref.sol b/test/libsolidity/semanticTests/array/pop/byte_array_pop_long_storage_empty_garbage_ref.sol index a014e761e..2299dcf07 100644 --- a/test/libsolidity/semanticTests/array/pop/byte_array_pop_long_storage_empty_garbage_ref.sol +++ b/test/libsolidity/semanticTests/array/pop/byte_array_pop_long_storage_empty_garbage_ref.sol @@ -15,7 +15,7 @@ contract c { } // ---- // test() -> -// gas irOptimized: 113782 +// gas irOptimized: 113734 // gas legacy: 131245 // gas legacyOptimized: 126668 // storageEmpty -> 1 diff --git a/test/libsolidity/semanticTests/array/pop/byte_array_pop_masking_long.sol b/test/libsolidity/semanticTests/array/pop/byte_array_pop_masking_long.sol index 07bad3a26..a7d794b20 100644 --- a/test/libsolidity/semanticTests/array/pop/byte_array_pop_masking_long.sol +++ b/test/libsolidity/semanticTests/array/pop/byte_array_pop_masking_long.sol @@ -9,6 +9,6 @@ contract c { } // ---- // test() -> 0x20, 33, 0x303030303030303030303030303030303030303030303030303030303030303, 0x0300000000000000000000000000000000000000000000000000000000000000 -// gas irOptimized: 107976 +// gas irOptimized: 107954 // gas legacy: 125420 // gas legacyOptimized: 122472 diff --git a/test/libsolidity/semanticTests/array/push/array_push.sol b/test/libsolidity/semanticTests/array/push/array_push.sol index 3e7ceb5a8..4755dec1d 100644 --- a/test/libsolidity/semanticTests/array/push/array_push.sol +++ b/test/libsolidity/semanticTests/array/push/array_push.sol @@ -17,5 +17,5 @@ contract c { // ---- // test() -> 5, 4, 3, 3 // gas irOptimized: 111363 -// gas legacy: 111807 +// gas legacy: 111806 // gas legacyOptimized: 111122 diff --git a/test/libsolidity/semanticTests/array/push/array_push_struct.sol b/test/libsolidity/semanticTests/array/push/array_push_struct.sol index bc09edeb5..8a8beb069 100644 --- a/test/libsolidity/semanticTests/array/push/array_push_struct.sol +++ b/test/libsolidity/semanticTests/array/push/array_push_struct.sol @@ -21,5 +21,5 @@ contract c { // ---- // test() -> 2, 3, 4, 5 // gas irOptimized: 135082 -// gas legacy: 147443 +// gas legacy: 147439 // gas legacyOptimized: 146434 diff --git a/test/libsolidity/semanticTests/array/reusing_memory.sol b/test/libsolidity/semanticTests/array/reusing_memory.sol index 92b0c06bf..948e687b0 100644 --- a/test/libsolidity/semanticTests/array/reusing_memory.sol +++ b/test/libsolidity/semanticTests/array/reusing_memory.sol @@ -25,5 +25,5 @@ contract Main { // ---- // f(uint256): 0x34 -> 0x46bddb1178e94d7f2892ff5f366840eb658911794f2c3a44c450aa2c505186c1 // gas irOptimized: 111924 -// gas legacy: 125162 -// gas legacyOptimized: 113012 +// gas legacy: 125160 +// gas legacyOptimized: 113612 diff --git a/test/libsolidity/semanticTests/byte_array_to_storage_cleanup.sol b/test/libsolidity/semanticTests/byte_array_to_storage_cleanup.sol index 95d3b916f..d59200775 100644 --- a/test/libsolidity/semanticTests/byte_array_to_storage_cleanup.sol +++ b/test/libsolidity/semanticTests/byte_array_to_storage_cleanup.sol @@ -30,7 +30,7 @@ contract C { // constructor() -> // gas irOptimized: 442530 // gas legacy: 711299 -// gas legacyOptimized: 481296 +// gas legacyOptimized: 481944 // h() -> 0x20, 0x40, 0x00, 0 // ~ emit ev(uint256[],uint256): 0x40, 0x21, 0x02, 0x00, 0x00 // g() -> 0x20, 0x40, 0, 0x00 diff --git a/test/libsolidity/semanticTests/calldata/copy_from_calldata_removes_bytes_data.sol b/test/libsolidity/semanticTests/calldata/copy_from_calldata_removes_bytes_data.sol index c87f6bfcf..e74812329 100644 --- a/test/libsolidity/semanticTests/calldata/copy_from_calldata_removes_bytes_data.sol +++ b/test/libsolidity/semanticTests/calldata/copy_from_calldata_removes_bytes_data.sol @@ -9,7 +9,7 @@ contract c { // EVMVersion: >=byzantium // ---- // (): 1, 2, 3, 4, 5 -> -// gas irOptimized: 155131 +// gas irOptimized: 155128 // gas legacy: 155473 // gas legacyOptimized: 155298 // checkIfDataIsEmpty() -> false diff --git a/test/libsolidity/semanticTests/constructor/arrays_in_constructors.sol b/test/libsolidity/semanticTests/constructor/arrays_in_constructors.sol index f9038fb76..c8f410107 100644 --- a/test/libsolidity/semanticTests/constructor/arrays_in_constructors.sol +++ b/test/libsolidity/semanticTests/constructor/arrays_in_constructors.sol @@ -26,4 +26,4 @@ contract Creator { // f(uint256,address[]): 7, 0x40, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 -> 7, 8 // gas irOptimized: 424508 // gas legacy: 581443 -// gas legacyOptimized: 444588 +// gas legacyOptimized: 445191 diff --git a/test/libsolidity/semanticTests/constructor/bytes_in_constructors_packer.sol b/test/libsolidity/semanticTests/constructor/bytes_in_constructors_packer.sol index 3361fa310..a369b8b78 100644 --- a/test/libsolidity/semanticTests/constructor/bytes_in_constructors_packer.sol +++ b/test/libsolidity/semanticTests/constructor/bytes_in_constructors_packer.sol @@ -26,4 +26,4 @@ contract Creator { // f(uint256,bytes): 7, 0x40, 78, "abcdefghijklmnopqrstuvwxyzabcdef", "ghijklmnopqrstuvwxyzabcdefghijkl", "mnopqrstuvwxyz" -> 7, "h" // gas irOptimized: 275487 // gas legacy: 418462 -// gas legacyOptimized: 291760 +// gas legacyOptimized: 292366 diff --git a/test/libsolidity/semanticTests/constructor/bytes_in_constructors_unpacker.sol b/test/libsolidity/semanticTests/constructor/bytes_in_constructors_unpacker.sol index b77793c0f..b43ef70ca 100644 --- a/test/libsolidity/semanticTests/constructor/bytes_in_constructors_unpacker.sol +++ b/test/libsolidity/semanticTests/constructor/bytes_in_constructors_unpacker.sol @@ -10,6 +10,6 @@ contract Test { // constructor(): 7, 0x40, 78, "abcdefghijklmnopqrstuvwxyzabcdef", "ghijklmnopqrstuvwxyzabcdefghijkl", "mnopqrstuvwxyz" -> // gas irOptimized: 268145 // gas legacy: 311324 -// gas legacyOptimized: 258388 +// gas legacyOptimized: 259036 // m_x() -> 7 // m_s() -> 0x20, 78, "abcdefghijklmnopqrstuvwxyzabcdef", "ghijklmnopqrstuvwxyzabcdefghijkl", "mnopqrstuvwxyz" diff --git a/test/libsolidity/semanticTests/constructor/constructor_arguments_external.sol b/test/libsolidity/semanticTests/constructor/constructor_arguments_external.sol index 3037aaa31..69662c5c7 100644 --- a/test/libsolidity/semanticTests/constructor/constructor_arguments_external.sol +++ b/test/libsolidity/semanticTests/constructor/constructor_arguments_external.sol @@ -19,6 +19,6 @@ contract Main { // constructor(): "abc", true // gas irOptimized: 104394 // gas legacy: 143300 -// gas legacyOptimized: 102961 +// gas legacyOptimized: 103609 // getFlag() -> true // getName() -> "abc" diff --git a/test/libsolidity/semanticTests/constructor/constructor_static_array_argument.sol b/test/libsolidity/semanticTests/constructor/constructor_static_array_argument.sol index 4698d26ee..857f29f7c 100644 --- a/test/libsolidity/semanticTests/constructor/constructor_static_array_argument.sol +++ b/test/libsolidity/semanticTests/constructor/constructor_static_array_argument.sol @@ -11,7 +11,7 @@ contract C { // constructor(): 1, 2, 3, 4 -> // gas irOptimized: 170999 // gas legacy: 218378 -// gas legacyOptimized: 176195 +// gas legacyOptimized: 176843 // a() -> 1 // b(uint256): 0 -> 2 // b(uint256): 1 -> 3 diff --git a/test/libsolidity/semanticTests/constructor_inheritance_init_order_2.sol b/test/libsolidity/semanticTests/constructor_inheritance_init_order_2.sol index 820c56a4e..6d2dc99c7 100644 --- a/test/libsolidity/semanticTests/constructor_inheritance_init_order_2.sol +++ b/test/libsolidity/semanticTests/constructor_inheritance_init_order_2.sol @@ -11,5 +11,5 @@ contract B is A { // constructor() -> // gas irOptimized: 119640 // gas legacy: 133594 -// gas legacyOptimized: 115341 +// gas legacyOptimized: 115989 // y() -> 42 diff --git a/test/libsolidity/semanticTests/constructor_with_params_diamond_inheritance.sol b/test/libsolidity/semanticTests/constructor_with_params_diamond_inheritance.sol index b2f66e450..537047634 100644 --- a/test/libsolidity/semanticTests/constructor_with_params_diamond_inheritance.sol +++ b/test/libsolidity/semanticTests/constructor_with_params_diamond_inheritance.sol @@ -23,7 +23,7 @@ contract D is B, C { // constructor(): 2, 0 -> // gas irOptimized: 151966 // gas legacy: 168623 -// gas legacyOptimized: 144577 +// gas legacyOptimized: 145225 // i() -> 2 // j() -> 2 // k() -> 1 diff --git a/test/libsolidity/semanticTests/constructor_with_params_inheritance.sol b/test/libsolidity/semanticTests/constructor_with_params_inheritance.sol index f5b20d981..7842cf497 100644 --- a/test/libsolidity/semanticTests/constructor_with_params_inheritance.sol +++ b/test/libsolidity/semanticTests/constructor_with_params_inheritance.sol @@ -14,6 +14,6 @@ contract D is C { // constructor(): 2, 0 -> // gas irOptimized: 121805 // gas legacy: 137193 -// gas legacyOptimized: 118548 +// gas legacyOptimized: 119196 // i() -> 2 // k() -> 1 diff --git a/test/libsolidity/semanticTests/events/event_dynamic_array_storage.sol b/test/libsolidity/semanticTests/events/event_dynamic_array_storage.sol index fec281c59..936fe4ef2 100644 --- a/test/libsolidity/semanticTests/events/event_dynamic_array_storage.sol +++ b/test/libsolidity/semanticTests/events/event_dynamic_array_storage.sol @@ -14,5 +14,5 @@ contract C { // createEvent(uint256): 42 -> // ~ emit E(uint256[]): 0x20, 0x03, 0x2a, 0x2b, 0x2c // gas irOptimized: 113485 -// gas legacy: 116314 +// gas legacy: 116313 // gas legacyOptimized: 114407 diff --git a/test/libsolidity/semanticTests/events/event_dynamic_array_storage_v2.sol b/test/libsolidity/semanticTests/events/event_dynamic_array_storage_v2.sol index 2b5a7114d..489d29950 100644 --- a/test/libsolidity/semanticTests/events/event_dynamic_array_storage_v2.sol +++ b/test/libsolidity/semanticTests/events/event_dynamic_array_storage_v2.sol @@ -15,5 +15,5 @@ contract C { // createEvent(uint256): 42 -> // ~ emit E(uint256[]): 0x20, 0x03, 0x2a, 0x2b, 0x2c // gas irOptimized: 113485 -// gas legacy: 116314 +// gas legacy: 116313 // gas legacyOptimized: 114407 diff --git a/test/libsolidity/semanticTests/events/event_dynamic_nested_array_storage_v2.sol b/test/libsolidity/semanticTests/events/event_dynamic_nested_array_storage_v2.sol index d6cfb68be..a6dee1b29 100644 --- a/test/libsolidity/semanticTests/events/event_dynamic_nested_array_storage_v2.sol +++ b/test/libsolidity/semanticTests/events/event_dynamic_nested_array_storage_v2.sol @@ -16,5 +16,5 @@ contract C { // createEvent(uint256): 42 -> // ~ emit E(uint256[][]): 0x20, 0x02, 0x40, 0xa0, 0x02, 0x2a, 0x2b, 0x02, 0x2c, 0x2d // gas irOptimized: 185033 -// gas legacy: 187495 +// gas legacy: 187493 // gas legacyOptimized: 184525 diff --git a/test/libsolidity/semanticTests/events/event_emit_from_other_contract.sol b/test/libsolidity/semanticTests/events/event_emit_from_other_contract.sol index 5b8827ce7..480679346 100644 --- a/test/libsolidity/semanticTests/events/event_emit_from_other_contract.sol +++ b/test/libsolidity/semanticTests/events/event_emit_from_other_contract.sol @@ -16,7 +16,7 @@ contract C { // ---- // constructor() -> // gas irOptimized: 165398 -// gas legacy: 244800 -// gas legacyOptimized: 171615 +// gas legacy: 244799 +// gas legacyOptimized: 172920 // deposit(bytes32), 18 wei: 0x1234 -> // ~ emit Deposit(address,bytes32,uint256) from 0x137aa4dfc0911524504fcd4d98501f179bc13b4a: #0xc06afe3a8444fc0004668591e8306bfb9968e79e, #0x1234, 0x00 diff --git a/test/libsolidity/semanticTests/externalContracts/FixedFeeRegistrar.sol b/test/libsolidity/semanticTests/externalContracts/FixedFeeRegistrar.sol index f9f53275b..4a140ce0b 100644 --- a/test/libsolidity/semanticTests/externalContracts/FixedFeeRegistrar.sol +++ b/test/libsolidity/semanticTests/externalContracts/FixedFeeRegistrar.sol @@ -76,7 +76,7 @@ contract FixedFeeRegistrar is Registrar { // constructor() // gas irOptimized: 384610 // gas legacy: 913421 -// gas legacyOptimized: 476928 +// gas legacyOptimized: 477576 // reserve(string), 69 ether: 0x20, 3, "abc" -> // ~ emit Changed(string): #0x4e03657aea45a94fc7d47ba826c8d667c0d1e6e33a64a036ec44f58fa12d6c45 // gas irOptimized: 45967 diff --git a/test/libsolidity/semanticTests/externalContracts/base64.sol b/test/libsolidity/semanticTests/externalContracts/base64.sol index fd7288c8f..502002138 100644 --- a/test/libsolidity/semanticTests/externalContracts/base64.sol +++ b/test/libsolidity/semanticTests/externalContracts/base64.sol @@ -35,7 +35,7 @@ contract test { // constructor() // gas irOptimized: 406907 // gas legacy: 737652 -// gas legacyOptimized: 526820 +// gas legacyOptimized: 527468 // encode_inline_asm(bytes): 0x20, 0 -> 0x20, 0 // encode_inline_asm(bytes): 0x20, 1, "f" -> 0x20, 4, "Zg==" // encode_inline_asm(bytes): 0x20, 2, "fo" -> 0x20, 4, "Zm8=" @@ -56,5 +56,5 @@ contract test { // gas legacyOptimized: 1199031 // encode_no_asm_large() // gas irOptimized: 3276081 -// gas legacy: 4705075 +// gas legacy: 4704075 // gas legacyOptimized: 2890075 diff --git a/test/libsolidity/semanticTests/externalContracts/deposit_contract.sol b/test/libsolidity/semanticTests/externalContracts/deposit_contract.sol index 5e815fad4..3c1573d14 100644 --- a/test/libsolidity/semanticTests/externalContracts/deposit_contract.sol +++ b/test/libsolidity/semanticTests/externalContracts/deposit_contract.sol @@ -178,7 +178,7 @@ contract DepositContract is IDepositContract, ERC165 { // constructor() // gas irOptimized: 1391860 // gas legacy: 2391952 -// gas legacyOptimized: 1752320 +// gas legacyOptimized: 1752944 // supportsInterface(bytes4): 0x0 -> 0 // supportsInterface(bytes4): 0xffffffff00000000000000000000000000000000000000000000000000000000 -> false # defined to be false by ERC-165 # // supportsInterface(bytes4): 0x01ffc9a700000000000000000000000000000000000000000000000000000000 -> true # ERC-165 id # diff --git a/test/libsolidity/semanticTests/externalContracts/prbmath_signed.sol b/test/libsolidity/semanticTests/externalContracts/prbmath_signed.sol index 8bb2b37c4..a773facc7 100644 --- a/test/libsolidity/semanticTests/externalContracts/prbmath_signed.sol +++ b/test/libsolidity/semanticTests/externalContracts/prbmath_signed.sol @@ -50,7 +50,7 @@ contract test { // constructor() // gas irOptimized: 1849535 // gas legacy: 2430726 -// gas legacyOptimized: 1854979 +// gas legacyOptimized: 1855646 // div(int256,int256): 3141592653589793238, 88714123 -> 35412542528203691288251815328 // gas irOptimized: 22137 // gas legacy: 22767 diff --git a/test/libsolidity/semanticTests/externalContracts/prbmath_unsigned.sol b/test/libsolidity/semanticTests/externalContracts/prbmath_unsigned.sol index 1ecfc154a..9aab32878 100644 --- a/test/libsolidity/semanticTests/externalContracts/prbmath_unsigned.sol +++ b/test/libsolidity/semanticTests/externalContracts/prbmath_unsigned.sol @@ -50,7 +50,7 @@ contract test { // constructor() // gas irOptimized: 1723666 // gas legacy: 2210160 -// gas legacyOptimized: 1734152 +// gas legacyOptimized: 1734788 // div(uint256,uint256): 3141592653589793238, 88714123 -> 35412542528203691288251815328 // gas irOptimized: 22004 // gas legacy: 22497 diff --git a/test/libsolidity/semanticTests/externalContracts/ramanujan_pi.sol b/test/libsolidity/semanticTests/externalContracts/ramanujan_pi.sol index a1f1d6395..abfd2d726 100644 --- a/test/libsolidity/semanticTests/externalContracts/ramanujan_pi.sol +++ b/test/libsolidity/semanticTests/externalContracts/ramanujan_pi.sol @@ -35,7 +35,7 @@ contract test { // constructor() // gas irOptimized: 407075 // gas legacy: 631753 -// gas legacyOptimized: 459425 +// gas legacyOptimized: 460073 // prb_pi() -> 3141592656369545286 // gas irOptimized: 57478 // gas legacy: 101655 diff --git a/test/libsolidity/semanticTests/externalContracts/snark.sol b/test/libsolidity/semanticTests/externalContracts/snark.sol index e92f95b4a..12099c002 100644 --- a/test/libsolidity/semanticTests/externalContracts/snark.sol +++ b/test/libsolidity/semanticTests/externalContracts/snark.sol @@ -296,7 +296,7 @@ contract Test { // pair() -> true // gas irOptimized: 269901 // gas legacy: 275678 -// gas legacyOptimized: 267193 +// gas legacyOptimized: 267130 // verifyTx() -> true // ~ emit Verified(string): 0x20, 0x16, "Successfully verified." // gas irOptimized: 783281 diff --git a/test/libsolidity/semanticTests/externalContracts/strings.sol b/test/libsolidity/semanticTests/externalContracts/strings.sol index 41820c8a4..6004eb893 100644 --- a/test/libsolidity/semanticTests/externalContracts/strings.sol +++ b/test/libsolidity/semanticTests/externalContracts/strings.sol @@ -51,7 +51,7 @@ contract test { // constructor() // gas irOptimized: 633020 // gas legacy: 1065857 -// gas legacyOptimized: 725207 +// gas legacyOptimized: 725867 // toSlice(string): 0x20, 11, "hello world" -> 11, 0xa0 // gas irOptimized: 22660 // gas legacy: 23190 diff --git a/test/libsolidity/semanticTests/functionCall/creation_function_call_with_args.sol b/test/libsolidity/semanticTests/functionCall/creation_function_call_with_args.sol index cbbded9d5..73b0c4ecf 100644 --- a/test/libsolidity/semanticTests/functionCall/creation_function_call_with_args.sol +++ b/test/libsolidity/semanticTests/functionCall/creation_function_call_with_args.sol @@ -17,5 +17,5 @@ contract D { // constructor(): 2 -> // gas irOptimized: 193567 // gas legacy: 241234 -// gas legacyOptimized: 192961 +// gas legacyOptimized: 194257 // f() -> 2 diff --git a/test/libsolidity/semanticTests/functionCall/creation_function_call_with_salt.sol b/test/libsolidity/semanticTests/functionCall/creation_function_call_with_salt.sol index e6b4ae90b..3396fd2fe 100644 --- a/test/libsolidity/semanticTests/functionCall/creation_function_call_with_salt.sol +++ b/test/libsolidity/semanticTests/functionCall/creation_function_call_with_salt.sol @@ -19,5 +19,5 @@ contract D { // constructor(): 2 -> // gas irOptimized: 193730 // gas legacy: 241606 -// gas legacyOptimized: 193193 +// gas legacyOptimized: 194489 // f() -> 2 diff --git a/test/libsolidity/semanticTests/functionCall/external_call_to_nonexisting.sol b/test/libsolidity/semanticTests/functionCall/external_call_to_nonexisting.sol index 86d3dcc8f..61349a0b9 100644 --- a/test/libsolidity/semanticTests/functionCall/external_call_to_nonexisting.sol +++ b/test/libsolidity/semanticTests/functionCall/external_call_to_nonexisting.sol @@ -24,7 +24,7 @@ contract C { // constructor(), 1 ether -> // gas irOptimized: 265110 // gas legacy: 441442 -// gas legacyOptimized: 292862 +// gas legacyOptimized: 293510 // f(uint256): 0 -> FAILURE // f(uint256): 1 -> FAILURE // f(uint256): 2 -> FAILURE diff --git a/test/libsolidity/semanticTests/functionCall/failed_create.sol b/test/libsolidity/semanticTests/functionCall/failed_create.sol index 6460794ad..2add2011f 100644 --- a/test/libsolidity/semanticTests/functionCall/failed_create.sol +++ b/test/libsolidity/semanticTests/functionCall/failed_create.sol @@ -19,7 +19,7 @@ contract C { // constructor(), 20 wei // gas irOptimized: 171806 // gas legacy: 285547 -// gas legacyOptimized: 168515 +// gas legacyOptimized: 169163 // f(uint256): 20 -> 0x137aa4dfc0911524504fcd4d98501f179bc13b4a // x() -> 1 // f(uint256): 20 -> FAILURE diff --git a/test/libsolidity/semanticTests/functionCall/gas_and_value_basic.sol b/test/libsolidity/semanticTests/functionCall/gas_and_value_basic.sol index 6ebab90ff..a82fb0d7a 100644 --- a/test/libsolidity/semanticTests/functionCall/gas_and_value_basic.sol +++ b/test/libsolidity/semanticTests/functionCall/gas_and_value_basic.sol @@ -39,8 +39,8 @@ contract test { // ---- // constructor(), 20 wei -> // gas irOptimized: 253950 -// gas legacy: 391588 -// gas legacyOptimized: 268089 +// gas legacy: 391587 +// gas legacyOptimized: 269385 // sendAmount(uint256): 5 -> 5 // outOfGas() -> FAILURE # call to helper should not succeed but amount should be transferred anyway # // checkState() -> false, 15 diff --git a/test/libsolidity/semanticTests/functionCall/gas_and_value_brace_syntax.sol b/test/libsolidity/semanticTests/functionCall/gas_and_value_brace_syntax.sol index 1cb5e0d54..c8dd70d25 100644 --- a/test/libsolidity/semanticTests/functionCall/gas_and_value_brace_syntax.sol +++ b/test/libsolidity/semanticTests/functionCall/gas_and_value_brace_syntax.sol @@ -38,8 +38,8 @@ contract test { // ---- // constructor(), 20 wei -> // gas irOptimized: 253950 -// gas legacy: 391588 -// gas legacyOptimized: 268089 +// gas legacy: 391587 +// gas legacyOptimized: 269385 // sendAmount(uint256): 5 -> 5 // outOfGas() -> FAILURE # call to helper should not succeed but amount should be transferred anyway # // checkState() -> false, 15 diff --git a/test/libsolidity/semanticTests/functionTypes/store_function.sol b/test/libsolidity/semanticTests/functionTypes/store_function.sol index 132a6c956..68eaa516a 100644 --- a/test/libsolidity/semanticTests/functionTypes/store_function.sol +++ b/test/libsolidity/semanticTests/functionTypes/store_function.sol @@ -27,4 +27,4 @@ contract C { // t() -> 9 // gas irOptimized: 99064 // gas legacy: 149095 -// gas legacyOptimized: 106188 +// gas legacyOptimized: 106788 diff --git a/test/libsolidity/semanticTests/immutable/multi_creation.sol b/test/libsolidity/semanticTests/immutable/multi_creation.sol index 4302b42e1..e63ab9014 100644 --- a/test/libsolidity/semanticTests/immutable/multi_creation.sol +++ b/test/libsolidity/semanticTests/immutable/multi_creation.sol @@ -29,6 +29,6 @@ contract C { // f() -> 3, 7, 5 // gas irOptimized: 124024 // gas legacy: 148528 -// gas legacyOptimized: 123971 +// gas legacyOptimized: 125171 // x() -> 7 // y() -> 5 diff --git a/test/libsolidity/semanticTests/immutable/use_scratch.sol b/test/libsolidity/semanticTests/immutable/use_scratch.sol index 0a5ccf729..f7212a970 100644 --- a/test/libsolidity/semanticTests/immutable/use_scratch.sol +++ b/test/libsolidity/semanticTests/immutable/use_scratch.sol @@ -16,7 +16,7 @@ contract C { // ---- // constructor(): 3 -> // gas irOptimized: 123542 -// gas legacy: 197645 -// gas legacyOptimized: 137678 +// gas legacy: 197644 +// gas legacyOptimized: 138326 // f() -> 84, 23 // m(uint256): 3 -> 7 diff --git a/test/libsolidity/semanticTests/inheritance/inherited_function_calldata_memory_interface.sol b/test/libsolidity/semanticTests/inheritance/inherited_function_calldata_memory_interface.sol index 74bf42ec7..af0faae49 100644 --- a/test/libsolidity/semanticTests/inheritance/inherited_function_calldata_memory_interface.sol +++ b/test/libsolidity/semanticTests/inheritance/inherited_function_calldata_memory_interface.sol @@ -24,4 +24,4 @@ contract B { // g() -> 42 // gas irOptimized: 100282 // gas legacy: 180440 -// gas legacyOptimized: 112596 +// gas legacyOptimized: 113202 diff --git a/test/libsolidity/semanticTests/inheritance/value_for_constructor.sol b/test/libsolidity/semanticTests/inheritance/value_for_constructor.sol index 3866d3be0..dbe715259 100644 --- a/test/libsolidity/semanticTests/inheritance/value_for_constructor.sol +++ b/test/libsolidity/semanticTests/inheritance/value_for_constructor.sol @@ -41,7 +41,7 @@ contract Main { // constructor(), 22 wei -> // gas irOptimized: 262320 // gas legacy: 392786 -// gas legacyOptimized: 261633 +// gas legacyOptimized: 262929 // getFlag() -> true // getName() -> "abc" // getBalances() -> 12, 10 diff --git a/test/libsolidity/semanticTests/isoltestTesting/balance_other_contract.sol b/test/libsolidity/semanticTests/isoltestTesting/balance_other_contract.sol index 306bc3567..50d96ab08 100644 --- a/test/libsolidity/semanticTests/isoltestTesting/balance_other_contract.sol +++ b/test/libsolidity/semanticTests/isoltestTesting/balance_other_contract.sol @@ -17,8 +17,8 @@ contract ClientReceipt { // ---- // constructor(), 2000 wei -> // gas irOptimized: 169915 -// gas legacy: 230038 -// gas legacyOptimized: 173883 +// gas legacy: 230037 +// gas legacyOptimized: 175179 // balance -> 1500 // gas irOptimized: 191881 // gas legacy: 235167 diff --git a/test/libsolidity/semanticTests/libraries/using_library_mappings_public.sol b/test/libsolidity/semanticTests/libraries/using_library_mappings_public.sol index 1f06908e2..f009291ef 100644 --- a/test/libsolidity/semanticTests/libraries/using_library_mappings_public.sol +++ b/test/libsolidity/semanticTests/libraries/using_library_mappings_public.sol @@ -20,5 +20,5 @@ contract Test { // library: Lib // f() -> 1, 0, 0x2a, 0x17, 0, 0x63 // gas irOptimized: 119642 -// gas legacy: 124674 +// gas legacy: 124670 // gas legacyOptimized: 119669 diff --git a/test/libsolidity/semanticTests/libraries/using_library_mappings_return.sol b/test/libsolidity/semanticTests/libraries/using_library_mappings_return.sol index e26ccacb9..88c330fdb 100644 --- a/test/libsolidity/semanticTests/libraries/using_library_mappings_return.sol +++ b/test/libsolidity/semanticTests/libraries/using_library_mappings_return.sol @@ -18,5 +18,5 @@ contract Test { // library: Lib // f() -> 1, 0, 0x2a, 0x17, 0, 0x63 // gas irOptimized: 120200 -// gas legacy: 125109 +// gas legacy: 125101 // gas legacyOptimized: 120128 diff --git a/test/libsolidity/semanticTests/operators/userDefined/operator_making_pure_external_call.sol b/test/libsolidity/semanticTests/operators/userDefined/operator_making_pure_external_call.sol index ce6a0f48d..97fbf5bf8 100644 --- a/test/libsolidity/semanticTests/operators/userDefined/operator_making_pure_external_call.sol +++ b/test/libsolidity/semanticTests/operators/userDefined/operator_making_pure_external_call.sol @@ -54,8 +54,8 @@ contract C { // testMul(int32,int32): 42, 10 -> 420 // gas irOptimized: 102563 // gas legacy: 183981 -// gas legacyOptimized: 123563 +// gas legacyOptimized: 124163 // testInc(int32): 42 -> 43 // gas irOptimized: 102386 // gas legacy: 183239 -// gas legacyOptimized: 123251 +// gas legacyOptimized: 123851 diff --git a/test/libsolidity/semanticTests/operators/userDefined/operator_making_view_external_call.sol b/test/libsolidity/semanticTests/operators/userDefined/operator_making_view_external_call.sol index f3f8ebdc6..14fefe664 100644 --- a/test/libsolidity/semanticTests/operators/userDefined/operator_making_view_external_call.sol +++ b/test/libsolidity/semanticTests/operators/userDefined/operator_making_view_external_call.sol @@ -60,8 +60,8 @@ contract C { // testMul(int32,int32): 42, 10 -> 420 // gas irOptimized: 102563 // gas legacy: 183981 -// gas legacyOptimized: 123563 +// gas legacyOptimized: 124163 // testInc(int32): 42 -> 43 // gas irOptimized: 102386 // gas legacy: 183239 -// gas legacyOptimized: 123251 +// gas legacyOptimized: 123851 diff --git a/test/libsolidity/semanticTests/salted_create/salted_create_with_value.sol b/test/libsolidity/semanticTests/salted_create/salted_create_with_value.sol index 34180fa69..c85a0b899 100644 --- a/test/libsolidity/semanticTests/salted_create/salted_create_with_value.sol +++ b/test/libsolidity/semanticTests/salted_create/salted_create_with_value.sol @@ -23,4 +23,4 @@ contract A { // f(), 10 ether -> 3007, 3008, 3009 // gas irOptimized: 253035 // gas legacy: 381063 -// gas legacyOptimized: 279694 +// gas legacyOptimized: 281494 diff --git a/test/libsolidity/semanticTests/smoke/constructor.sol b/test/libsolidity/semanticTests/smoke/constructor.sol index 79b92867b..a8584933c 100644 --- a/test/libsolidity/semanticTests/smoke/constructor.sol +++ b/test/libsolidity/semanticTests/smoke/constructor.sol @@ -14,7 +14,7 @@ contract C { // constructor(), 2 wei: 3 -> // gas irOptimized: 104412 // gas legacy: 148308 -// gas legacyOptimized: 106727 +// gas legacyOptimized: 107375 // state() -> 3 // balance() -> 2 // balance -> 2 diff --git a/test/libsolidity/semanticTests/state/blockhash_basic.sol b/test/libsolidity/semanticTests/state/blockhash_basic.sol index 01069aa0c..c705d1d0d 100644 --- a/test/libsolidity/semanticTests/state/blockhash_basic.sol +++ b/test/libsolidity/semanticTests/state/blockhash_basic.sol @@ -14,7 +14,7 @@ contract C { // constructor() // gas irOptimized: 108150 // gas legacy: 152179 -// gas legacyOptimized: 106750 +// gas legacyOptimized: 107398 // genesisHash() -> 0x3737373737373737373737373737373737373737373737373737373737373737 // currentHash() -> 0 // f(uint256): 0 -> 0x3737373737373737373737373737373737373737373737373737373737373737 diff --git a/test/libsolidity/semanticTests/structs/copy_from_mapping.sol b/test/libsolidity/semanticTests/structs/copy_from_mapping.sol index 75898d316..25b110309 100644 --- a/test/libsolidity/semanticTests/structs/copy_from_mapping.sol +++ b/test/libsolidity/semanticTests/structs/copy_from_mapping.sol @@ -36,7 +36,7 @@ contract C { } // ---- // to_state() -> 0x20, 0x60, 0xa0, 7, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 -// gas irOptimized: 121487 +// gas irOptimized: 121481 // gas legacy: 123069 // gas legacyOptimized: 121759 // to_storage() -> 0x20, 0x60, 0xa0, 7, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 diff --git a/test/libsolidity/semanticTests/structs/copy_struct_array_from_storage.sol b/test/libsolidity/semanticTests/structs/copy_struct_array_from_storage.sol index 937eeeaf4..3bfd61d3b 100644 --- a/test/libsolidity/semanticTests/structs/copy_struct_array_from_storage.sol +++ b/test/libsolidity/semanticTests/structs/copy_struct_array_from_storage.sol @@ -88,7 +88,7 @@ contract Test { // ---- // test1() -> true // gas irOptimized: 152882 -// gas legacy: 153012 +// gas legacy: 153011 // gas legacyOptimized: 152637 // test2() -> true // test3() -> true diff --git a/test/libsolidity/semanticTests/structs/copy_substructures_from_mapping.sol b/test/libsolidity/semanticTests/structs/copy_substructures_from_mapping.sol index 902cc80e5..93cfc9f79 100644 --- a/test/libsolidity/semanticTests/structs/copy_substructures_from_mapping.sol +++ b/test/libsolidity/semanticTests/structs/copy_substructures_from_mapping.sol @@ -44,7 +44,7 @@ contract C { } // ---- // to_state() -> 0x20, 0x60, 0xa0, 7, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 -// gas irOptimized: 121598 +// gas irOptimized: 121578 // gas legacy: 123208 // gas legacyOptimized: 121766 // to_storage() -> 0x20, 0x60, 0xa0, 7, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 diff --git a/test/libsolidity/semanticTests/structs/copy_substructures_to_mapping.sol b/test/libsolidity/semanticTests/structs/copy_substructures_to_mapping.sol index 66716e400..fcdbd294e 100644 --- a/test/libsolidity/semanticTests/structs/copy_substructures_to_mapping.sol +++ b/test/libsolidity/semanticTests/structs/copy_substructures_to_mapping.sol @@ -58,7 +58,7 @@ contract C { // from_state() -> 0x20, 0x60, 0xa0, 21, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 // gas irOptimized: 121709 // gas legacy: 123282 -// gas legacyOptimized: 121871 +// gas legacyOptimized: 121865 // from_calldata((bytes,uint16[],uint16)): 0x20, 0x60, 0xa0, 21, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 -> 0x20, 0x60, 0xa0, 0x15, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 // gas irOptimized: 115131 // gas legacy: 122516 diff --git a/test/libsolidity/semanticTests/structs/memory_structs_nested_load.sol b/test/libsolidity/semanticTests/structs/memory_structs_nested_load.sol index e5b139d5c..29c2eda1d 100644 --- a/test/libsolidity/semanticTests/structs/memory_structs_nested_load.sol +++ b/test/libsolidity/semanticTests/structs/memory_structs_nested_load.sol @@ -67,6 +67,6 @@ contract Test { // ---- // load() -> 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 // gas irOptimized: 110317 -// gas legacy: 112964 +// gas legacy: 112963 // gas legacyOptimized: 110876 // store() -> 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 diff --git a/test/libsolidity/semanticTests/structs/struct_containing_bytes_copy_and_delete.sol b/test/libsolidity/semanticTests/structs/struct_containing_bytes_copy_and_delete.sol index c8437300d..0af42a169 100644 --- a/test/libsolidity/semanticTests/structs/struct_containing_bytes_copy_and_delete.sol +++ b/test/libsolidity/semanticTests/structs/struct_containing_bytes_copy_and_delete.sol @@ -23,7 +23,7 @@ contract c { // ---- // storageEmpty -> 1 // set(uint256,bytes,uint256): 12, 0x60, 13, 33, "12345678901234567890123456789012", "3" -> true -// gas irOptimized: 133582 +// gas irOptimized: 133579 // gas legacy: 134628 // gas legacyOptimized: 133874 // test(uint256): 32 -> "3" @@ -31,7 +31,7 @@ contract c { // copy() -> true // storageEmpty -> 1 // set(uint256,bytes,uint256): 12, 0x60, 13, 33, "12345678901234567890123456789012", "3" -> true -// gas irOptimized: 133582 +// gas irOptimized: 133579 // gas legacy: 134628 // gas legacyOptimized: 133874 // storageEmpty -> 0 diff --git a/test/libsolidity/semanticTests/structs/struct_copy.sol b/test/libsolidity/semanticTests/structs/struct_copy.sol index a321f0686..db940c8d5 100644 --- a/test/libsolidity/semanticTests/structs/struct_copy.sol +++ b/test/libsolidity/semanticTests/structs/struct_copy.sol @@ -36,12 +36,12 @@ contract c { // ---- // set(uint256): 7 -> true // gas irOptimized: 109893 -// gas legacy: 110597 +// gas legacy: 110593 // gas legacyOptimized: 110003 // retrieve(uint256): 7 -> 1, 3, 4, 2 // copy(uint256,uint256): 7, 8 -> true // gas irOptimized: 118582 -// gas legacy: 119147 +// gas legacy: 119146 // gas legacyOptimized: 118619 // retrieve(uint256): 7 -> 1, 3, 4, 2 // retrieve(uint256): 8 -> 1, 3, 4, 2 diff --git a/test/libsolidity/semanticTests/structs/struct_delete_storage_with_array.sol b/test/libsolidity/semanticTests/structs/struct_delete_storage_with_array.sol index d76618bbc..9865127e7 100644 --- a/test/libsolidity/semanticTests/structs/struct_delete_storage_with_array.sol +++ b/test/libsolidity/semanticTests/structs/struct_delete_storage_with_array.sol @@ -42,10 +42,10 @@ contract C { } // ---- // f() -> -// gas irOptimized: 113210 +// gas irOptimized: 113198 // gas legacy: 113591 -// gas legacyOptimized: 113103 +// gas legacyOptimized: 113098 // g() -> -// gas irOptimized: 118580 +// gas irOptimized: 118566 // gas legacy: 118764 -// gas legacyOptimized: 118172 +// gas legacyOptimized: 118168 diff --git a/test/libsolidity/semanticTests/structs/structs.sol b/test/libsolidity/semanticTests/structs/structs.sol index b5e9d10bb..7e6d9d8e7 100644 --- a/test/libsolidity/semanticTests/structs/structs.sol +++ b/test/libsolidity/semanticTests/structs/structs.sol @@ -31,6 +31,6 @@ contract test { // check() -> false // set() -> // gas irOptimized: 134417 -// gas legacy: 135246 +// gas legacy: 135245 // gas legacyOptimized: 134062 // check() -> true diff --git a/test/libsolidity/semanticTests/types/mapping/copy_from_mapping_to_mapping.sol b/test/libsolidity/semanticTests/types/mapping/copy_from_mapping_to_mapping.sol index b17ba6d91..c872e5e77 100644 --- a/test/libsolidity/semanticTests/types/mapping/copy_from_mapping_to_mapping.sol +++ b/test/libsolidity/semanticTests/types/mapping/copy_from_mapping_to_mapping.sol @@ -30,5 +30,5 @@ contract C { // ---- // f() -> 0x20, 7, 8, 9, 0xa0, 13, 2, 0x40, 0xa0, 2, 3, 4, 2, 3, 4 // gas irOptimized: 197082 -// gas legacy: 199891 +// gas legacy: 199890 // gas legacyOptimized: 196817 diff --git a/test/libsolidity/semanticTests/userDefinedValueType/calldata.sol b/test/libsolidity/semanticTests/userDefinedValueType/calldata.sol index 2e85c3463..247fe25f1 100644 --- a/test/libsolidity/semanticTests/userDefinedValueType/calldata.sol +++ b/test/libsolidity/semanticTests/userDefinedValueType/calldata.sol @@ -49,11 +49,11 @@ contract C { } // ---- // test_f() -> true -// gas irOptimized: 122388 +// gas irOptimized: 122370 // gas legacy: 126030 // gas legacyOptimized: 123120 // test_g() -> true -// gas irOptimized: 106740 +// gas irOptimized: 106707 // gas legacy: 112300 // gas legacyOptimized: 107649 // addresses(uint256): 0 -> 0x18 diff --git a/test/libsolidity/semanticTests/userDefinedValueType/erc20.sol b/test/libsolidity/semanticTests/userDefinedValueType/erc20.sol index 27ab530cd..242279c15 100644 --- a/test/libsolidity/semanticTests/userDefinedValueType/erc20.sol +++ b/test/libsolidity/semanticTests/userDefinedValueType/erc20.sol @@ -114,8 +114,8 @@ contract ERC20 { // constructor() // ~ emit Transfer(address,address,uint256): #0x00, #0x1212121212121212121212121212120000000012, 0x14 // gas irOptimized: 352698 -// gas legacy: 834932 -// gas legacyOptimized: 412648 +// gas legacy: 834930 +// gas legacyOptimized: 413296 // totalSupply() -> 20 // gas irOptimized: 23415 // gas legacy: 23653 diff --git a/test/libsolidity/semanticTests/various/address_code.sol b/test/libsolidity/semanticTests/various/address_code.sol index 606737746..588dbd675 100644 --- a/test/libsolidity/semanticTests/various/address_code.sol +++ b/test/libsolidity/semanticTests/various/address_code.sol @@ -16,7 +16,7 @@ contract C { // constructor() -> // gas irOptimized: 172853 // gas legacy: 241796 -// gas legacyOptimized: 153454 +// gas legacyOptimized: 154102 // initCode() -> 0x20, 0 // f() -> true // g() -> 0 diff --git a/test/libsolidity/semanticTests/various/create_calldata.sol b/test/libsolidity/semanticTests/various/create_calldata.sol index b40b0eab4..b4429da5a 100644 --- a/test/libsolidity/semanticTests/various/create_calldata.sol +++ b/test/libsolidity/semanticTests/various/create_calldata.sol @@ -10,5 +10,5 @@ contract C { // constructor(): 42 -> // gas irOptimized: 144924 // gas legacy: 173845 -// gas legacyOptimized: 137677 +// gas legacyOptimized: 138325 // s() -> 0x20, 0 diff --git a/test/libsolidity/semanticTests/various/erc20.sol b/test/libsolidity/semanticTests/various/erc20.sol index b752a5210..e3e2fa001 100644 --- a/test/libsolidity/semanticTests/various/erc20.sol +++ b/test/libsolidity/semanticTests/various/erc20.sol @@ -97,8 +97,8 @@ contract ERC20 { // constructor() // ~ emit Transfer(address,address,uint256): #0x00, #0x1212121212121212121212121212120000000012, 0x14 // gas irOptimized: 353276 -// gas legacy: 807683 -// gas legacyOptimized: 408718 +// gas legacy: 807681 +// gas legacyOptimized: 409366 // totalSupply() -> 20 // gas irOptimized: 23415 // gas legacy: 23524 diff --git a/test/libsolidity/semanticTests/various/negative_stack_height.sol b/test/libsolidity/semanticTests/various/negative_stack_height.sol index 3c9130e9f..a3363caaa 100644 --- a/test/libsolidity/semanticTests/various/negative_stack_height.sol +++ b/test/libsolidity/semanticTests/various/negative_stack_height.sol @@ -66,4 +66,4 @@ contract C { // ---- // constructor() -> // gas legacy: 575272 -// gas legacyOptimized: 345026 +// gas legacyOptimized: 345674 diff --git a/test/libsolidity/semanticTests/various/selfdestruct.sol b/test/libsolidity/semanticTests/various/selfdestruct.sol index 366bac41d..24227f0b4 100644 --- a/test/libsolidity/semanticTests/various/selfdestruct.sol +++ b/test/libsolidity/semanticTests/various/selfdestruct.sol @@ -31,8 +31,8 @@ contract D { // ---- // constructor(), 1 ether -> // gas irOptimized: 186970 -// gas legacy: 255973 -// gas legacyOptimized: 178919 +// gas legacy: 255972 +// gas legacyOptimized: 180215 // c() -> 0x137aa4dfc0911524504fcd4d98501f179bc13b4a // balance: 0x137aa4dfc0911524504fcd4d98501f179bc13b4a -> 1000000000000000000 // balance -> 0 diff --git a/test/libsolidity/semanticTests/various/senders_balance.sol b/test/libsolidity/semanticTests/various/senders_balance.sol index 37d6919db..f53fc1922 100644 --- a/test/libsolidity/semanticTests/various/senders_balance.sol +++ b/test/libsolidity/semanticTests/various/senders_balance.sol @@ -17,6 +17,6 @@ contract D { // ---- // constructor(), 27 wei -> // gas irOptimized: 168729 -// gas legacy: 218459 -// gas legacyOptimized: 167292 +// gas legacy: 218458 +// gas legacyOptimized: 168591 // f() -> 27 diff --git a/test/libsolidity/semanticTests/various/staticcall_for_view_and_pure.sol b/test/libsolidity/semanticTests/various/staticcall_for_view_and_pure.sol index 1306529d4..df5c6baa6 100644 --- a/test/libsolidity/semanticTests/various/staticcall_for_view_and_pure.sol +++ b/test/libsolidity/semanticTests/various/staticcall_for_view_and_pure.sol @@ -39,8 +39,8 @@ contract D { // fview() -> FAILURE // gas irOptimized: 98438588 // gas legacy: 98438774 -// gas legacyOptimized: 98438580 +// gas legacyOptimized: 98438589 // fpure() -> FAILURE // gas irOptimized: 98438589 // gas legacy: 98438774 -// gas legacyOptimized: 98438580 +// gas legacyOptimized: 98438590 diff --git a/test/libsolidity/semanticTests/various/swap_in_storage_overwrite.sol b/test/libsolidity/semanticTests/various/swap_in_storage_overwrite.sol index bd5a59519..3422c8121 100644 --- a/test/libsolidity/semanticTests/various/swap_in_storage_overwrite.sol +++ b/test/libsolidity/semanticTests/various/swap_in_storage_overwrite.sol @@ -27,7 +27,7 @@ contract c { // y() -> 0, 0 // set() -> // gas irOptimized: 109684 -// gas legacy: 109728 +// gas legacy: 109727 // gas legacyOptimized: 109680 // x() -> 1, 2 // y() -> 3, 4 diff --git a/test/libsolidity/semanticTests/various/value_complex.sol b/test/libsolidity/semanticTests/various/value_complex.sol index 880dfbc20..d054158fd 100644 --- a/test/libsolidity/semanticTests/various/value_complex.sol +++ b/test/libsolidity/semanticTests/various/value_complex.sol @@ -20,6 +20,6 @@ contract test { // ---- // constructor(), 20 wei -> // gas irOptimized: 173055 -// gas legacy: 252296 -// gas legacyOptimized: 180352 +// gas legacy: 252295 +// gas legacyOptimized: 181660 // sendAmount(uint256): 5 -> 8 diff --git a/test/libsolidity/semanticTests/various/value_insane.sol b/test/libsolidity/semanticTests/various/value_insane.sol index 897b9faba..e3fe19b72 100644 --- a/test/libsolidity/semanticTests/various/value_insane.sol +++ b/test/libsolidity/semanticTests/various/value_insane.sol @@ -19,6 +19,6 @@ contract test { // ---- // constructor(), 20 wei -> // gas irOptimized: 173919 -// gas legacy: 253820 -// gas legacyOptimized: 180784 +// gas legacy: 253819 +// gas legacyOptimized: 182080 // sendAmount(uint256): 5 -> 8 diff --git a/test/libsolidity/semanticTests/viaYul/copy_struct_invalid_ir_bug.sol b/test/libsolidity/semanticTests/viaYul/copy_struct_invalid_ir_bug.sol index ed5ecf3ed..51e92159a 100644 --- a/test/libsolidity/semanticTests/viaYul/copy_struct_invalid_ir_bug.sol +++ b/test/libsolidity/semanticTests/viaYul/copy_struct_invalid_ir_bug.sol @@ -22,5 +22,5 @@ contract C { // ---- // f() -> // gas irOptimized: 112980 -// gas legacy: 112890 +// gas legacy: 112888 // gas legacyOptimized: 112580 diff --git a/test/libsolidity/syntaxTests/sizeLimits/bytecode_too_large.sol b/test/libsolidity/syntaxTests/sizeLimits/bytecode_too_large.sol index 36aa0c076..3baf3a842 100644 --- a/test/libsolidity/syntaxTests/sizeLimits/bytecode_too_large.sol +++ b/test/libsolidity/syntaxTests/sizeLimits/bytecode_too_large.sol @@ -9,4 +9,4 @@ contract test { // ==== // EVMVersion: >=shanghai // ---- -// Warning 5574: (21-27154): Contract code size is 27186 bytes and exceeds 24576 bytes (a limit introduced in Spurious Dragon). This contract may not be deployable on Mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries. +// Warning 5574: (21-27154): Contract code size is 27189 bytes and exceeds 24576 bytes (a limit introduced in Spurious Dragon). This contract may not be deployable on Mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries. diff --git a/test/libsolidity/syntaxTests/sizeLimits/bytecode_too_large_abiencoder_v1.sol b/test/libsolidity/syntaxTests/sizeLimits/bytecode_too_large_abiencoder_v1.sol index a0c7267d0..388b54ac4 100644 --- a/test/libsolidity/syntaxTests/sizeLimits/bytecode_too_large_abiencoder_v1.sol +++ b/test/libsolidity/syntaxTests/sizeLimits/bytecode_too_large_abiencoder_v1.sol @@ -9,4 +9,4 @@ contract test { // ==== // EVMVersion: >=shanghai // ---- -// Warning 5574: (21-27154): Contract code size is 27205 bytes and exceeds 24576 bytes (a limit introduced in Spurious Dragon). This contract may not be deployable on Mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries. +// Warning 5574: (21-27154): Contract code size is 27208 bytes and exceeds 24576 bytes (a limit introduced in Spurious Dragon). This contract may not be deployable on Mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries. diff --git a/test/libsolidity/syntaxTests/sizeLimits/combined_too_large_shanghai.sol b/test/libsolidity/syntaxTests/sizeLimits/combined_too_large_shanghai.sol index 4854b0a64..73ecbd5e2 100644 --- a/test/libsolidity/syntaxTests/sizeLimits/combined_too_large_shanghai.sol +++ b/test/libsolidity/syntaxTests/sizeLimits/combined_too_large_shanghai.sol @@ -26,7 +26,7 @@ contract test { // ==== // EVMVersion: =shanghai // ---- -// Warning 5574: (0-27130): Contract code size is 27186 bytes and exceeds 24576 bytes (a limit introduced in Spurious Dragon). This contract may not be deployable on Mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries. -// Warning 5574: (27132-27224): Contract code size is 27212 bytes and exceeds 24576 bytes (a limit introduced in Spurious Dragon). This contract may not be deployable on Mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries. -// Warning 5574: (27226-27319): Contract code size is 27211 bytes and exceeds 24576 bytes (a limit introduced in Spurious Dragon). This contract may not be deployable on Mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries. -// Warning 3860: (27321-27398): Contract initcode size is 54626 bytes and exceeds 49152 bytes (a limit introduced in Shanghai). This contract may not be deployable on Mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries. +// Warning 5574: (0-27130): Contract code size is 27189 bytes and exceeds 24576 bytes (a limit introduced in Spurious Dragon). This contract may not be deployable on Mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries. +// Warning 5574: (27132-27224): Contract code size is 27215 bytes and exceeds 24576 bytes (a limit introduced in Spurious Dragon). This contract may not be deployable on Mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries. +// Warning 5574: (27226-27319): Contract code size is 27214 bytes and exceeds 24576 bytes (a limit introduced in Spurious Dragon). This contract may not be deployable on Mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries. +// Warning 3860: (27321-27398): Contract initcode size is 54632 bytes and exceeds 49152 bytes (a limit introduced in Shanghai). This contract may not be deployable on Mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries. diff --git a/test/libsolidity/syntaxTests/sizeLimits/initcode_too_large_shanghai.sol b/test/libsolidity/syntaxTests/sizeLimits/initcode_too_large_shanghai.sol index 1f648c630..e4cf0f838 100644 --- a/test/libsolidity/syntaxTests/sizeLimits/initcode_too_large_shanghai.sol +++ b/test/libsolidity/syntaxTests/sizeLimits/initcode_too_large_shanghai.sol @@ -27,4 +27,4 @@ contract test { // ==== // EVMVersion: =shanghai // ---- -// Warning 3860: (20321-20415): Contract initcode size is 60893 bytes and exceeds 49152 bytes (a limit introduced in Shanghai). This contract may not be deployable on Mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries. +// Warning 3860: (20321-20415): Contract initcode size is 60902 bytes and exceeds 49152 bytes (a limit introduced in Shanghai). This contract may not be deployable on Mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries. diff --git a/test/libyul/objectCompiler/datacopy.yul b/test/libyul/objectCompiler/datacopy.yul index cb9fbcb18..719b109f1 100644 --- a/test/libyul/objectCompiler/datacopy.yul +++ b/test/libyul/objectCompiler/datacopy.yul @@ -33,7 +33,7 @@ object "a" { // /* "source":153:170 */ // 0x00 // /* "source":150:151 */ -// dup1 +// 0x00 // /* "source":143:171 */ // sstore // /* "source":188:205 */ @@ -47,6 +47,6 @@ object "a" { // stop // data_acaf3289d7b601cbd114fb36c4d29c85bbfd5e133f14cb355c3fd8d99367964f 48656c6c6f2c20576f726c6421 // } -// Bytecode: 6009600b5f3960095ff3fe5f8055600d5f5200fe -// Opcodes: PUSH1 0x9 PUSH1 0xB PUSH0 CODECOPY PUSH1 0x9 PUSH0 RETURN INVALID PUSH0 DUP1 SSTORE PUSH1 0xD PUSH0 MSTORE STOP INVALID +// Bytecode: 6009600b5f3960095ff3fe5f5f55600d5f5200fe +// Opcodes: PUSH1 0x9 PUSH1 0xB PUSH0 CODECOPY PUSH1 0x9 PUSH0 RETURN INVALID PUSH0 PUSH0 SSTORE PUSH1 0xD PUSH0 MSTORE STOP INVALID // SourceMappings: 57:15:0:-:0;38:17;35:1;26:47;88:15;85:1;78:26 diff --git a/test/libyul/objectCompiler/dataoffset_self.yul b/test/libyul/objectCompiler/dataoffset_self.yul index 7c38b9502..ae123ba49 100644 --- a/test/libyul/objectCompiler/dataoffset_self.yul +++ b/test/libyul/objectCompiler/dataoffset_self.yul @@ -7,13 +7,13 @@ object "a" { // /* "source":32:47 */ // 0x00 // /* "source":29:30 */ -// dup1 +// 0x00 // /* "source":22:48 */ // sstore // /* "source":20:50 */ // stop // stop // data_acaf3289d7b601cbd114fb36c4d29c85bbfd5e133f14cb355c3fd8d99367964f 48656c6c6f2c20576f726c6421 -// Bytecode: 5f805500fe -// Opcodes: PUSH0 DUP1 SSTORE STOP INVALID +// Bytecode: 5f5f5500fe +// Opcodes: PUSH0 PUSH0 SSTORE STOP INVALID // SourceMappings: 32:15:0:-:0;29:1;22:26;20:30 diff --git a/test/libyul/objectCompiler/sourceLocations.yul b/test/libyul/objectCompiler/sourceLocations.yul index 1c8477324..b5fab36c3 100644 --- a/test/libyul/objectCompiler/sourceLocations.yul +++ b/test/libyul/objectCompiler/sourceLocations.yul @@ -41,15 +41,13 @@ object "a" { // // sub_0: assembly { // /* "def.sol":70:72 */ -// 0x00 -// dup1 -// sstore +// sstore(0x00, 0x00) // /* "abc.sol":2:5 */ // mstore(0x00, 0x0d) // stop // stop // data_acaf3289d7b601cbd114fb36c4d29c85bbfd5e133f14cb355c3fd8d99367964f 48656c6c6f2c20576f726c6421 // } -// Bytecode: 6009600b5f3960095ff3fe5f8055600d5f5200fe -// Opcodes: PUSH1 0x9 PUSH1 0xB PUSH0 CODECOPY PUSH1 0x9 PUSH0 RETURN INVALID PUSH0 DUP1 SSTORE PUSH1 0xD PUSH0 MSTORE STOP INVALID +// Bytecode: 6009600b5f3960095ff3fe5f5f55600d5f5200fe +// Opcodes: PUSH1 0x9 PUSH1 0xB PUSH0 CODECOPY PUSH1 0x9 PUSH0 RETURN INVALID PUSH0 PUSH0 SSTORE PUSH1 0xD PUSH0 MSTORE STOP INVALID // SourceMappings: 0:2::-:0;;;;5:1;0:2;