The wasm_of_ocaml compiler is generating code using a fresh local variable for each intermediate value. We rely on wasm-opt to optimize this. Since #6677, the binary parser will reject functions with more then 50,000 locals. We are currently reaching this limit on some large programs. Maybe it would make sense to raise this limit since wasm-opt is expected to take as input unoptimized code. Or maybe there should be an option to lift the limit?