-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Many new wasm features are enabled if compile wasm32v1-none on LLVM 20+ #140174
Copy link
Copy link
Closed
Closed
Copy link
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-LTOArea: Link-time optimization (LTO)Area: Link-time optimization (LTO)A-linkersArea: linkers... you gotta love linkersArea: linkers... you gotta love linkersC-bugCategory: This is a bug.Category: This is a bug.E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleO-wasmTarget: WASM (WebAssembly), http://webassembly.org/Target: WASM (WebAssembly), http://webassembly.org/T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-LTOArea: Link-time optimization (LTO)Area: Link-time optimization (LTO)A-linkersArea: linkers... you gotta love linkersArea: linkers... you gotta love linkersC-bugCategory: This is a bug.Category: This is a bug.E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleO-wasmTarget: WASM (WebAssembly), http://webassembly.org/Target: WASM (WebAssembly), http://webassembly.org/T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Code
@alexcrichton
Code is minimized as much as possible and here is demo repository: https://github.com/StackOverflowExcept1on/wasm-builder-regression/
wasm-checker- simple CLI tool that passes wasm to parity-wasm parser (it does not support new wasm features like reference-types, bulk-memory)wasm-program- this is smart contract that just allocates vectorwasm-project- some intermediate directory that is generated by our utilitygit clone https://github.com/StackOverflowExcept1on/wasm-builder-regression.git cd wasm-builder-regression/wasm-project cargo clean ./check.shopcode 252 is
memory.fill(bulk memory operations)target was
wasm32v1-none, however here we see bunch of wasm features that shouldn't be here.I've also added LLVM IR output so we can report this bug to LLVM as soon as possible:
If I remove flag
-C linker-plugin-lto, it works as expectedI expected to see this happen: I can use
-C linker-plugin-ltoto optimize my .wasm programs and it results in generating the correct code for thewasm32v1-nonetargetInstead, this happened: there is some kind of conflict between compiler flags?
Version it worked on
Problems started after #135763. I don't have time to bisect exact version right now.
Version with regression
rustc +nightly-2025-04-22 --version --verbose: