Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inline asm: The "=m" constraint causes an illegal instruction error #24808

Closed
gnutick opened this issue Apr 25, 2015 · 2 comments
Closed

Inline asm: The "=m" constraint causes an illegal instruction error #24808

gnutick opened this issue Apr 25, 2015 · 2 comments

Comments

@gnutick
Copy link

gnutick commented Apr 25, 2015

Hi!

Rust ends with an illegal instruction error when I try to compile this:

let mut c: u64;
asm!("" : "=m" (c));

Maybe because it generates wrong LLVM IR.

Rust/LLVM IR:

%1 = call i64 asm "", "=m,~{dirflag},~{fpsr},~{flags}"(), !srcloc !0
store i64 %1, i64* %c

Clang/LLVM IR:

call void asm "", "=*m,~{dirflag},~{fpsr},~{flags}"(i64* %c) #1, !srcloc !1

Meta

rustc --version --verbose:
rustc 1.1.0-dev (2214860 2015-04-24) (built 2015-04-25)
binary: rustc
commit-hash: 2214860
commit-date: 2015-04-24
build-date: 2015-04-25
host: x86_64-unknown-linux-gnu
release: 1.1.0-dev

clang --version:
Ubuntu clang version 3.6.0-2ubuntu1 (tags/RELEASE_360/final) (based on LLVM 3.6.0)
Target: x86_64-pc-linux-gnu
Thread model: posix

@nagisa
Copy link
Member

nagisa commented Apr 25, 2015

Citing @huonw:

Our constraints do not duplicate GCC; its just that we implement several of the same constraints GCC supports.

Anyway, duplicate of #16383

@steveklabnik
Copy link
Member

Yes, this is a duplicate. Thanks though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants