Skip to content

rustc-LLVM ERROR: Cannot select with -C code-model=large #138899

Open
@konstin

Description

@konstin

Unfortunately this is far from an MRE, but I wanted to report it anyway in case anyone else has the same problem.

Code

uv in https://github.com/astral-sh/uv at ae880c6d48671fbe84d304d3f86b9666ee89ad54

When compiling in CI in a 32-bit docker container, we were experiencing out-of-memory errors ("rustc-LLVM ERROR: out of memory" - the build was using more than 4GB of RAM), so we tried adding -C code-model=large to reduce the memory usage. Doing so, we instead got an error with llvm internals when compiling the final binary (https://github.com/astral-sh/uv/actions/runs/14040533118/job/39309313189):

# Start a 32-bit docker container
$ docker run -it --rm -v $(pwd):/io quay.io/pypa/manylinux2014_i686:latest
# Install Rust
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Compie the program
$ cargo rustc --release --features self-update --bin uv -p uv -- -Ccode-model=large
[...]
rustc-LLVM ERROR: Cannot select: 0x876befa0: i32,ch = load<(load (s64) from jump-table, align 4), sext from i64> 0x99d77300, 0x876bef50, undef:i32
  0x876bef50: i32 = add 0x876be690, 0x876bed70
    0x876be690: i32 = shl 0x876e0910, Constant:i8<3>
      0x876e0910: i32,ch = CopyFromReg 0x99d77300, Register:i32 %27
        0x876beb90: i32 = Register %27
      0x876e01e0: i8 = Constant<3>
    0x876bed70: i32 = add X86ISD::GlobalBaseReg:i32, 0x876be230
      0x876bee10: i32 = X86ISD::GlobalBaseReg
      0x876be230: i32 = X86ISD::Wrapper TargetJumpTable:i32<0> [TF=4]
        0x876e0dc0: i32 = TargetJumpTable<0> [TF=4]
  0x876bea00: i32 = undef
In function: _ZN10axoupdater7release16get_release_list28_$u7b$$u7b$closure$u7d$$u7d$17hf4e3434edf50ffdeE

Meta

rustc --version --verbose:

rustc 1.85.1 (4eb161250 2025-03-15)
binary: rustc
commit-hash: 4eb161250e340c8f48f66e2b929ef4a5bed7c181
commit-date: 2025-03-15
host: i686-unknown-linux-gnu
release: 1.85.1
LLVM version: 19.1.7

Error output

rustc-LLVM ERROR: Cannot select: 0x876befa0: i32,ch = load<(load (s64) from jump-table, align 4), sext from i64> 0x99d77300, 0x876bef50, undef:i32
  0x876bef50: i32 = add 0x876be690, 0x876bed70
    0x876be690: i32 = shl 0x876e0910, Constant:i8<3>
      0x876e0910: i32,ch = CopyFromReg 0x99d77300, Register:i32 %27
        0x876beb90: i32 = Register %27
      0x876e01e0: i8 = Constant<3>
    0x876bed70: i32 = add X86ISD::GlobalBaseReg:i32, 0x876be230
      0x876bee10: i32 = X86ISD::GlobalBaseReg
      0x876be230: i32 = X86ISD::Wrapper TargetJumpTable:i32<0> [TF=4]
        0x876e0dc0: i32 = TargetJumpTable<0> [TF=4]
  0x876bea00: i32 = undef
In function: _ZN10axoupdater7release16get_release_list28_$u7b$$u7b$closure$u7d$$u7d$17hf4e3434edf50ffdeE

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️O-x86_32Target: x86 processors, 32 bit (like i686-*) (IA-32)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions