<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Less efficient encoding using direct object emission"
   href="https://llvm.org/bugs/show_bug.cgi?id=22947">22947</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Less efficient encoding using direct object emission
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>MC
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>russell_gallop@sn.scee.net
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>For the following source the code generated by direct object emission is less
efficient than outputting to .s. Using r232386.

$ cat decrement.c
int foo(int a) {
    return --a;
}
$ clang -c decrement.c -o decrement.o
$ clang -S decrement.c -o decrement.s && clang -c decrement.s -o
decrement_via_s.o
$ objdump -d decrement.o

decrement.o:     file format elf64-x86-64


Disassembly of section .text:

0000000000000000 <foo>:
   0:   55                      push   %rbp
   1:   48 89 e5                mov    %rsp,%rbp
   4:   89 7d fc                mov    %edi,-0x4(%rbp)
   7:   8b 7d fc                mov    -0x4(%rbp),%edi
   a:   81 c7 ff ff ff ff       add    $0xffffffff,%edi
  10:   89 7d fc                mov    %edi,-0x4(%rbp)
  13:   89 f8                   mov    %edi,%eax
  15:   5d                      pop    %rbp
  16:   c3                      retq
$ objdump -d decrement_via_s.o

decrement_via_s.o:     file format elf64-x86-64


Disassembly of section .text:

0000000000000000 <foo>:
   0:   55                      push   %rbp
   1:   48 89 e5                mov    %rsp,%rbp
   4:   89 7d fc                mov    %edi,-0x4(%rbp)
   7:   8b 7d fc                mov    -0x4(%rbp),%edi
   a:   83 c7 ff                add    $0xffffffff,%edi
   d:   89 7d fc                mov    %edi,-0x4(%rbp)
  10:   89 f8                   mov    %edi,%eax
  12:   5d                      pop    %rbp
  13:   c3                      retq</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>