rust-lang / rust-lang/rust

Code size regression (opt-level=z) after 1.82.0

Open
#132,888 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-LLVM C-bug 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 struct Point {
    x: i32,
    y: i32,
}

#[no_mangle]
pub fn f(a: Point) -> i32 { 
    if a.x > 0 && a.y < 0 || a.x < 0 && a.y > 0 {
        a.x * a.y
    } else {
        a.x + a.y
    }
}

Link: https://godbolt.org/z/ocs7aGMxK

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Rust reproducer and the linked Godbolt comparison; compare generated code and code size at opt-level=z across compiler versions around 1.82.0. Done means the regression is explained and a focused compiler test or change demonstrates that the size regression no longer occurs.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.