Skip to content

Marking registers as clobbered on AArch64 inside an asm! block fails to compile #75761

Closed
@bkolobara

Description

@bkolobara

If any of the floating point registers (v0-31) or x30 on AArch64 are used as an out parameter the code doesn't compile. The following code using v0 fails to compile on rustc 1.47.0-nightly (e15510ca3 2020-08-20):

#![feature(asm)]

fn main() {
    unsafe {
        asm!(
             "",
             out("v0") _
        );
    }
}

with an error:

error: non-trivial scalar-to-vector conversion, possible invalid constraint for vector type
 --> src/main.rs:6:15
  |
6 |              "",
  |               ^

If x30 is used instead of v0 another error message is shown:

error: couldn't allocate output register for constraint '{x30}'
 --> src/main.rs:6:15
  |
6 |              "",
  |               ^

I expect it to be possible to use all these registers as parameters to out.

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.F-asm`#![feature(asm)]` (not `llvm_asm`)O-ArmTarget: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 stateT-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