Created attachment 20328 [details] IR Originally reported at https://github.com/rustwasm/wasm-bindgen/issues/199 this bug then transitioned into https://github.com/rust-lang/rust/issues/50869 where I've been able to reduce this a bit to hopefully be in a reportable state for LLVM itself. The attached IR, when run through `llc` at O0, will generate a wasm object file which fails to pass `wasm-validate`: $ llc foo.ll -O0 -filetype=obj -o foo.o $ wasm-validate --enable-mutable-globals foo.o --ignore-custom-section-errors tmp.o:0000b36: error: type mismatch in call, expected [i32, i32] but got [i32] I think this appears to be the root cause for causing the final linked module to become invalid as well. Note that the attached IR is also reduced via bugpoint so it may look a little odd. If there's any questions about this though, please feel free to let me know!
Fixed in r332947.
Awesome, thanks for the quick fix!