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

            Bug ID: 47530
           Summary: clang asm chooses poorly for "=rm"
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangb...@nondot.org
          Reporter: l...@mit.edu
                CC: llvm-bugs@lists.llvm.org, neeil...@live.com,
                    richard-l...@metafoo.co.uk

With this trivial input:

unsigned long mov_zero(void)
{
        unsigned long ret;
        asm ("movq $0, %0" : "=rm" (ret));
        return ret;
}

clang -O2 generates this very suboptimal output:

mov_zero:
 movq $0x0,-0x8(%rsp)
 mov -0x8(%rsp),%rax
 ret

gcc does much better:

mov_zero:
 mov $0x0,%rax
 retq

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to