<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 --- - X86CallFrameOptimization leads to generation of two consecutive `subl $8, %esp` (instead of a single `subl $16, %esp)"
   href="https://llvm.org/bugs/show_bug.cgi?id=28542">28542</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>X86CallFrameOptimization leads to generation of two consecutive `subl $8, %esp` (instead of a single `subl $16, %esp)
          </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>All
          </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>nicolasweber@gmx.de
          </td>
        </tr>

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

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>$ cat fastisel.cc 
struct S {
  void f(int a);
};
void g() {
  S s;
  s.f(43);
}
$ bin/clang -m32 -O2 -c fastisel.cc -S  -o - -mllvm -no-x86-call-frame-opt
...
    pushl    %ebp
    movl    %esp, %ebp
    subl    $24, %esp
    leal    -8(%ebp), %eax
    movl    %eax, (%esp)
    movl    $43, 4(%esp)
    calll    __ZN1S1fEi
...

This looks reasonable. Now:

$ bin/clang -m32 -O2 -c fastisel.cc -S  -o - 
...
    pushl    %ebp
    movl    %esp, %ebp
    subl    $8, %esp
    subl    $8, %esp
    leal    -8(%ebp), %eax
    pushl    $43
    pushl    %eax
    calll    __ZN1S1fEi

This would look much better if it said `subl $16, %esp` instead.</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>