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

Upper 8 registers are no longer available to asm statement #24329

Closed
hjl-tools opened this issue Jun 26, 2015 · 2 comments
Closed

Upper 8 registers are no longer available to asm statement #24329

hjl-tools opened this issue Jun 26, 2015 · 2 comments
Assignees
Labels
bugzilla Issues migrated from bugzilla

Comments

@hjl-tools
Copy link
Contributor

Bugzilla Link 23955
Resolution FIXED
Resolved on Jun 29, 2015 16:37
Version trunk
OS Linux
CC @MatzeB

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:

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]$

@hjl-tools
Copy link
Contributor Author

assigned to @MatzeB

@MatzeB
Copy link
Contributor

MatzeB commented Jun 29, 2015

Recommitted the patch with a fix for this in r241002.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla
Projects
None yet
Development

No branches or pull requests

2 participants