https://llvm.org/bugs/show_bug.cgi?id=23955

            Bug ID: 23955
           Summary: Upper 8 registers are no longer available to asm
                    statement
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified

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

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to