Skip to content

EVM codegen in solc optimizations prevents contract builds #586

Description

@xermicus

Even though we request the optimized Yul IR (and no EVM bytecode) from solc, due to some optimization passes, EVM codegen is still run. This can lead to errors like Could not create stack layout after 1000 iterations. when compiling contracts. But PVM is in no way connected to the EVM stack, and Yul has no stack layout.

Setting yulDetails.stackAllocation: false does not help in all cases, found a reproducer that just OOMs (my 64gb machine) in that case.

solc is notorious for such bugs. Because even --optimize --no-optimize-yul forcefully enables stack allocation, we have no other choice left than to request the unoptimized Yul. This should be fine; any remaining solc optimizer gains which are not covered yet by either the NY opt or LLVM passes can just be re-implemented in NY.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions