rust-lang / rust-lang/rust

llvm error: `SmallVector unable to grow. Requested capacity (4294967296) is larger than maximum value for size type (4294967295)`

Open
#126,009 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-LLVM C-bug I-ICE T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

auto-reduced (treereduce-rust):

use std::arch::{asm, global_asm};

macro_rules! wrap {
    () => {
        macro_rules! _a {
            () => {
                "i-"
            };
        }
    };
}

wrap!();

use _a as a;

fn main() {}

global_asm!(a!());


original:

//@only-aarch64
//@check-pass
//@edition: 2018

// https://github.com/rust-lang/rust/issues/98291

use std::arch::{asm, global_asm};

macro_rules! wrap {
    () => {
        macro_rules! _a {
            () => {
                "i-"
            };
        }
    };
}

wrap!();

use _a as a;

fn main() {
    unsafe { asm!(a!()); }
}

global_asm!(a!());

Version information

rustc 1.80.0-nightly (44701e070 2024-06-04)
binary: rustc
commit-hash: 44701e070c8453df10df1984944258018ac21610
commit-date: 2024-06-04
host: x86_64-unknown-linux-gnu
release: 1.80.0-nightly
LLVM version: 18.1.6

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc -Zunstable-options --edition=2024

Program output

warning: unused import: `asm`
 --> /tmp/icemaker_global_tempdir.Wtk05IMuNYhF/rustc_testrunner_tmpdir_reporting.fOHm0ahY7sgf/mvce.rs:1:17
  |
1 | use std::arch::{asm, global_asm};
  |                 ^^^
  |
  = note: `#[warn(unused_imports)]` on by default

rustc-LLVM ERROR: SmallVector unable to grow. Requested capacity (4294967296) is larger than maximum value for size type (4294967295)

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 by running the reduced a.rs reproducer with the reported rustc command and confirm the LLVM SmallVector capacity error. Compare it with the original asm! and global_asm! cases and the listed Rust version and LLVM version. Done means the reproducer no longer causes the compiler ICE and an appropriate regression test covers the behavior.

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
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.