Code size regression (opt-level=z) after 1.73.0 (~40%)
Open
Nobody has claimed this yet.
C-bug
I-heavy
P-low
regression-untriaged
T-compiler
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
Code:
#![no_main]
#[no_mangle]
pub fn f(a: i32) -> i32 {
let mut result = a + a;
for i in 0..a {
for j in 0..a {
if i * j % 2 == 0 && i + j > a / 2 {
result += i + j;
}
for k in 0..a {
if (i + j + k) % 3 == 0 && (i * j * k) % 2 != 0 {
result += k * (i + j);
}
}
}
}
result
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the minimal Rust reproducer in the issue and the linked Godbolt comparison, compiling it with opt-level=z around Rust 1.73.0 and the affected version. Compare the generated code size and inspect compiler changes relevant to the regression. Done means identifying the cause and confirming that the reproducer no longer shows the roughly 40% increase.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100