Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICE in CompilerStack.cpp when compiling with --optimize --no-optimize-yul #15645

Closed
haoyang9804 opened this issue Dec 15, 2024 · 2 comments
Closed
Labels

Comments

@haoyang9804
Copy link
Contributor

Description

Reproducible code generated by fuzzer:

contract contract0 {
  event event1(int128 var2);

  string internal var3;
  int128 internal var4;

  constructor(int128 var5) {
    (int128(-5219264694000113017) * (var4));
  }

  function func6() internal {
    do {
      emit event1(var4);
    } while(bool(true));
  }

  function func7(int128 var8) internal returns (int128 var9) {
    do {
      emit event1(var4);
    } while((var4) >= (var4));
  }
}

contract contract10 {
  error error11(int16[1][] array12);

  struct struct15 {
    contract0 contract_instance16;
  }

  mapping(int128 => string[6]) internal mapping17;
  string internal var21;

  constructor() {
    int128 var25;
    for ((payable(0x5A82764cBC088bA28E98cB5e19cF842CC805ffBd)); (var25 < var25); var21) {
      ((var25)--);
    }
  }

  function func23(string calldata var24) internal pure {
    bool var26;
    while ((var26 = var26)) {}
  }
}

Compiling command to trigger this ICE:

../solidity/build/solc/solc generated_programs/program_2024-12-15_11:58:4_102.sol --opcodes --optimize --no-optimize-yul --optimize-runs 126 --model-checker-invariants contract --model-checker-solvers eld --model-checker-div-mod-no-slacks --model-checker-show-unproved --model-checker-timeout 15 --model-checker-show-proved-safe --model-checker-engine bmc --model-checker-targets all

ICE message:

Internal compiler error:
/solidity/libsolidity/interface/CompilerStack.cpp(1737): Throw in function std::string solidity::frontend::CompilerStack::createMetadata(const Contract &, bool) const
Dynamic exception type: boost::wrapexcept<solidity::langutil::InternalCompilerError>
std::exception::what: Solidity assertion failed
[solidity::util::tag_comment*] = Solidity assertion failed

Environment

  • Compiler version: 0.8.29-develop.2024.11.8+commit.323ad934.mod.Darwin.appleclang
@haoyang9804
Copy link
Contributor Author

I think this ICE is caused by intermingling --optimize and --no-optimize-yul

@r0qs
Copy link
Member

r0qs commented Dec 16, 2024

I think this ICE is caused by intermingling --optimize and --no-optimize-yul

Hi @haoyang9804, you are correct, this is the same issue as #15641. Removing one of the conflicting flags resolves the compilation problem. We will address this issue, but I’ll be closing this one here, as it is a duplicate. :)

@r0qs r0qs closed this as completed Dec 16, 2024
@cameel cameel changed the title ICE in CompilerStack.cpp ICE in CompilerStack.cpp when compiling with --optimize --no-optimize-yul Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants