We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Before r239309, this works:
[hjl@gnu-32 bin]$ cat x.c void foo (int p) { register int reg asm("r8") = p; asm volatile("# %0" : : "r" (reg)); } [hjl@gnu-32 bin]$ ./clang -S -O2 x.c [hjl@gnu-32 bin]$ cat x.s .text .file "x.c" .globl foo .align 16, 0x90 .type foo,@function foo: # @foo .cfi_startproc
movl %edi, %r8d #APP #NO_APP retq
.Lfunc_end0: .size foo, .Lfunc_end0-foo .cfi_endproc
Now, I got
[hjl@gnu-6 bin]$ ./clang -S -O2 x.c x.c:5:24: error: couldn't allocate input reg for constraint '{r8}' asm volatile("# %0" : : "r" (reg)); ^ 1 error generated. [hjl@gnu-6 bin]$
If I use "r8d", I get
[hjl@gnu-6 bin]$ cat x.c void foo (int p) { register int reg asm("r8d") = p; asm volatile("# %0" : : "r" (reg)); } [hjl@gnu-6 bin]$ ./clang -S -O2 x.c x.c:4:28: error: unknown register name 'r8d' in asm register int reg asm("r8d") = p; ^ 1 error generated. [hjl@gnu-6 bin]$
The text was updated successfully, but these errors were encountered:
assigned to @MatzeB
Sorry, something went wrong.
Recommitted the patch with a fix for this in r241002.
MatzeB
No branches or pull requests
Extended Description
Before r239309, this works:
[hjl@gnu-32 bin]$ cat x.c
void
foo (int p)
{
register int reg asm("r8") = p;
asm volatile("# %0" : : "r" (reg));
}
[hjl@gnu-32 bin]$ ./clang -S -O2 x.c
[hjl@gnu-32 bin]$ cat x.s
.text
.file "x.c"
.globl foo
.align 16, 0x90
.type foo,@function
foo: # @foo
.cfi_startproc
BB#0:
.Lfunc_end0:
.size foo, .Lfunc_end0-foo
.cfi_endproc
Now, I got
[hjl@gnu-6 bin]$ ./clang -S -O2 x.c
x.c:5:24: error: couldn't allocate input reg for constraint '{r8}'
asm volatile("# %0" : : "r" (reg));
^
1 error generated.
[hjl@gnu-6 bin]$
If I use "r8d", I get
[hjl@gnu-6 bin]$ cat x.c
void
foo (int p)
{
register int reg asm("r8d") = p;
asm volatile("# %0" : : "r" (reg));
}
[hjl@gnu-6 bin]$ ./clang -S -O2 x.c
x.c:4:28: error: unknown register name 'r8d' in asm
register int reg asm("r8d") = p;
^
1 error generated.
[hjl@gnu-6 bin]$
The text was updated successfully, but these errors were encountered: