<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 --- - [x86] Use pop to restore stack instead of add"
   href="https://llvm.org/bugs/show_bug.cgi?id=26333">26333</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[x86] Use pop to restore stack instead of add
          </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>Linux
          </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>Backend: X86
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>hans@chromium.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Blocks</th>
          <td>26299
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Consider the following at -Os:

  struct S {
    void foo();
  };

  S *bar(int);

  void baz() {
    bar(0)->foo();
  }

Clang will generate:

00000000 <?baz@@YAXXZ>:
   0:    6a 00                    push   $0x0
   2:    e8 00 00 00 00           call   7 <?baz@@YAXXZ+0x7>
   7:    83 c4 04                 add    $0x4,%esp
   a:    89 c1                    mov    %eax,%ecx
   c:    e9 00 00 00 00           jmp    11 <@feat.00+0x10>

Instead of 'add $0x4,%esp', MSVC would do 'pop %ecx' and save two bytes,
because %ecx isn't live there anyway.

This incurs a memory access, but since nothing depends on the result, maybe
that would be OK, at least at -Os?</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>