[llvm-bugs] [Bug 37675] New: Redundant mov in a simple tail call

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jun 4 03:50:42 PDT 2018


            Bug ID: 37675
           Summary: Redundant mov in a simple tail call
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: hans at chromium.org
                CC: llvm-bugs at lists.llvm.org
            Blocks: 26299

Consider the following:

  void f(void*, int);

  void g(void *p, void *q, int x) {
      return f(q, 0);

clang -Os:

    movq %rsi, %rax  <--- Why not mov to %rdi directly?
    xorl %esi, %esi
    movq %rax, %rdi
    jmp f

gcc -Os:

    movq %rsi, %rdi
    xorl %esi, %esi
    jmp f

Referenced Bugs:

[Bug 26299] [meta][X86] Size optimization opportunities (in particular for
32-bit Chromium on Windows)
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180604/c73bff4c/attachment.html>

More information about the llvm-bugs mailing list