wasm-opt segmentation fault with, but not with --debug
I have a binary wasm file demo1 (zipped here).
If I use the binary of binaryen/ wasm-opt available on the releases page, version 117, and I call
wasm-opt -O2 --enable-tail-call --enable-reference-types --enable-gc --enable-mutable-globals -o demo1-opt_O2.wasm demo1
I get a segfault:
Segmentation fault (core dumped)
The same happens for -O3, but not with O1.
If I add the --debug flag to the when doing -O2 or -O3, the command succeeds and optimizes the binary.
If I build binaryen/ wasm-opt from source, I don't get any segmentation faults.
I see the same thing: 117 release segfaults. Building 117 from source works, and building tip of tree also works. So this might be a compiler issue in the release somehow. Very odd. I'm not sure what is a good way to debug that.
Closing this because it's not reproducible in a way that would let us fix anything. Please reopen or file new issues if later releases have similar issues, though.