Repository navigation
[rustc] ICE: scalable vectors are unsupported in x86_64 calling convention classifier when compiling AArch64 SVE intrinsic returning scalable vector type #153593
Description
Description
rustc panics with "scalable vectors are unsupported" when compiling a function that calls an AArch64 SVE LLVM intrinsic returning a scalable vector type (svbool4_t). The crash occurs in the x86_64 calling convention classifier (callconv/x86_64.rs:62) during ABI computation at monomorphization time, even though the type is an AArch64-specific scalable vector that should never reach the x86_64 ABI classifier.
Reproducer
#![crate_type = "lib"]
#![allow(internal_features)]
#![feature(rustc_attrs, link_llvm_intrinsics)]
#[rustc_scalable_vector(4)]
#[allow(non_camel_case_types)]
#[repr(transparent)]
pub struct svbool4_t(bool);
pub fn trigger() -> svbool4_t {
unsafe extern "C" {
#[link_name = "llvm.aarch64.sve.whilelo.nxv4i1.u64"]
fn _svwhilelt_b32_u64(op1: u64, op2: u64) -> svbool4_t;
}
unsafe { _svwhilelt_b32_u64(0, 1) }
}Command
rustc --edition=2021 -C opt-level=1 -C codegen-units=1 reproduce.rs
Expected behavior
Either a graceful error is emitted indicating that AArch64 SVE scalable vector types cannot be used in this context on x86_64, or the ABI classifier correctly skips or handles scalable vector types without panicking.
Actual behavior
thread 'rustc' panicked at compiler/rustc_target/src/callconv/x86_64.rs:62:51:
scalable vectors are unsupported
error: the compiler unexpectedly panicked. This is a bug
Root cause
The call chain is:
fn_abi_of_instance [computing call ABI of `svwhilelt_b32_u64::_svwhilelt_b32_u64`]
→ fn_abi_adjust_for_abi
→ compute_abi_info (x86_64.rs:256)
→ classify_arg (x86_64.rs:106)
→ classify (x86_64.rs:62) ← panic: scalable vectors are unsupported
The x86_64 classify function encounters a scalable vector type and hits an unconditional panic! with no prior guard. The #[rustc_scalable_vector] attribute marks svbool4_t as a scalable vector, and when _svwhilelt_b32_u64 is monomorphized, its ABI is computed through the x86_64 classifier which does not handle this case gracefully.
Environment
- Compiler:
rustc 1.95.0-nightly - Host target:
x86_64-unknown-linux-gnu - Flags:
-C opt-level=1 -C codegen-units=1 - Requires:
#![feature(rustc_attrs, link_llvm_intrinsics)] - rustc commit:
9b1f8ff42d110b0ca138116745be921df5dc97e7
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNo status
- StatusShow more project fieldsDone
Activity
lqd commentedon Mar 9, 2026
Scalable vectors support still incomplete and actively worked on. There are a couple of PRs in flight to expand it though, like #153286 and after it lands (as well as the intrinsics in stdarch) I expect this issue at least to be fixed. Shouldn’t be too long.
eggyal commentedon Mar 9, 2026
davidtwco commentedon Mar 9, 2026
The bug here is that you're trying to use scalable vectors while compiling to x86, which doesn't have any form of scalable vectors, using
--targetwill help. rustc's scalable vector support is only implemented in the aarch64-specific parts of the LLVM backend at the moment. The actual fix here is that we should probably error if#[rustc_scalable_vector]is used while compiling for a non-AArch64 or non-RISC-V target.In general though, you shouldn't need to define intrinsics like this yourself, we intend to upstream intrinsics to stdarch soon. The unstable features you need to opt into to do this will never be stabilised.
stdarch_aarch64_sve) #145052lqd commentedon Mar 9, 2026
BTW @YuanchengJiang, I wanted to ask about this issue, #153599, and #153601, that you've opened recently.
These don't seem like issues one would encounter in a regular project, so I'm wondering if you are fuzzing rustc with unstable features and internal attributes? And if so, could you describe what kind of tooling and automation, if any, you are using in this workflow? This is to see if joining forces with the existing fuzzing efforts would be worthwhile, and on the stable surface syntax instead. Thanks!
Rollup merge of rust-lang#153608 - davidtwco:sve-unsupported-architec…
Rollup merge of rust-lang#153608 - davidtwco:sve-unsupported-architec…
Rollup merge of rust-lang#153608 - davidtwco:sve-unsupported-architec…
YuanchengJiang commentedon Mar 10, 2026
Hi @lqd. Yes, our research team is working on fuzzing rustc (may include unstable features and internal attributes). We are developing a new approach that is related to https://github.com/php/flowfusion. It has been effective at discovering bugs in various compilers/interpreters (e.g., CPython, LLVM, Swift, PHP). Kindly let me know anything I need to pay attention in addition to https://rustc-dev-guide.rust-lang.org/fuzzing.html. Thanks!
Unrolled build for #153608
lqd commentedon Mar 10, 2026
Good to know, that sounds like a cool approach! I hope it yields good results when using stable code. The fuzzing guidelines to follow you linked to are indeed what should help fuzzers focus on interesting issues. The ones that are important to track and fix, compared to internal things breaking when held wrong for example.
Have fun!