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

assertion failure with -O4 #6989

Open
zapashcanon opened this issue Oct 7, 2024 · 3 comments
Open

assertion failure with -O4 #6989

zapashcanon opened this issue Oct 7, 2024 · 3 comments

Comments

@zapashcanon
Copy link

zapashcanon commented Oct 7, 2024

Hi,

When running Binaryen with -O4 I get the following assertion failure:

$ wasm-opt --all-features a.out.wasm -O4 -o tmp.wasm
wasm-opt: ~/dev/cpp/binaryen/src/ir/block-utils.h:54: wasm::Expression* wasm::BlockUtils::simplifyToContents(wasm::Block*, T*, bool) [with T = wasm::Vacuum]: Assertion `block->type.isConcrete() && singleton->type == Type::unreachable' failed.
zsh: IOT instruction  wasm-opt --all-features a.out.wasm -O4

I'm on a recent version:

$ wasm-opt --version
wasm-opt version 119 (version_119-55-g7e1413902)

Running with -O3 does not give an error:

$ wasm-opt --all-features a.out.wasm -O3 -o tmp.wasm
$ ls | grep tmp
tmp.wasm

The source file is attached. I only have the binary sorry. I uploaded it as a .jpeg because otherwise GitHub won't let me... renaming it should be enough: file.jpeg

@kripken
Copy link
Member

kripken commented Oct 7, 2024

I can't seem to download that. Try uploading it in a zip (or tar.gz or such), that is the usual workaround for this github issue.

@zapashcanon
Copy link
Author

Here you are: archive.zip

@kripken
Copy link
Member

kripken commented Oct 7, 2024

Thanks. It looks like this is hitting a limitation of the Flatten pass which runs in -O4. It does not yet handle arbitrary branching instructions like BrOn. Unfortunately it also emits a confusing error message about that, which we should fix.

For now, if you are using anything more than MVP wasm instructions, -O4 and Flatten won't work, sorry about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants