Skip to content

ICE with asm macro #89875

Closed
Closed
@dobasy

Description

@dobasy

Code

#![feature(asm)]

#[target_feature(enable = "avx")]
pub unsafe fn foo() {
    asm!(
        "/* {} */",
        out(ymm_reg) _,
    );
}

Meta

rustc --version --verbose:

rustc 1.57.0-nightly (dfc5add91 2021-10-13)
binary: rustc
commit-hash: dfc5add915e8bf4accbb7cf4de00351a7c6126a1
commit-date: 2021-10-13
host: x86_64-pc-windows-msvc
release: 1.57.0-nightly
LLVM version: 13.0.0

Error output

thread 'rustc' panicked at 'assertion failed: matches!(reg, InlineAsmRegOrRegClass :: Reg(_))', compiler\rustc_codegen_llvm\src\asm.rs:179:25
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.57.0-nightly (dfc5add91 2021-10-13) running on x86_64-pc-windows-msvc

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type lib

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack
error: could not compile `foo`

Also, #[target_feature(enable = "avx2")] doesn't allow the use of ymm_reg:

error: register class `ymm_reg` requires the `avx` target feature

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️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