There seems to be an optimization bug in wasm-opt at 5646ea6
See x.tar.gz:
% tar xvzf x.tar.gz
x.wasm
x.mjs
pkg/dart2wasm/bin/run_wasm.js
% d8 $PWD/pkg/dart2wasm/bin/run_wasm.js -- $PWD/x.mjs $PWD/x.wasm
f invoked
now optimize & run again
% out/ReleaseX64/wasm-opt --enable-gc --enable-reference-types --enable-multivalue --enable-exception-handling --enable-nontrapping-float-to-int --enable-sign-ext --enable-bulk-memory --enable-threads --enable-simd '--no-inline=*<noInline>*' --closed-world --traps-never-happen --type-unfinalizing -Os --type-ssa --gufa -Os --type-merging -Os --type-finalizing --minimize-rec-groups -g x.wasm -g -o x.wasm
% d8 $PWD/pkg/dart2wasm/bin/run_wasm.js -- $PWD/x.mjs $PWD/x.wasm
%
=> It no longer prints f invoked.
There seems to be an optimization bug in
wasm-optat 5646ea6See x.tar.gz:
now optimize & run again
=> It no longer prints
f invoked.