Fails to optimize away trivial ownership move of Vec in high optimization levels #140057
Labels
C-bug
Category: This is a bug.
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
I tried these codes:
https://godbolt.org/z/3je47cr9a
and:
I expected to see this happen:
Both expressions should produce identical assembly code.
Instead, this happened:
The second version of the code generated approximately 200 more lines of assembly compared to the first version.
The additional assembly appears to stem from the line:
let temp_bridge_1080 = node.content;
Since this is a simple move operation (zero-cost abstraction in Rust), it should not introduce any runtime overhead or code bloat. This suggests a potential missed optimization opportunity in the compiler.
Could you please review them? Thank you!
Meta
The text was updated successfully, but these errors were encountered: