<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 --- - size optimization: avoid stack adjustments after __asan_report_loadN"
   href="https://llvm.org/bugs/show_bug.cgi?id=28931">28931</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>size optimization: avoid stack adjustments after __asan_report_loadN
          </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>Backend: X86
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>rnk@google.com
          </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>Consider:
int many_loads(int *a, int *b, int *c, int *d) {
  int s = 0;
  s += *a;
  s += *b;
  s += *c;
  s += *d;
  return s;
}

We generate many sequences like:
        pushl   %eax
        calll   ___asan_report_load4
        addl    $4, %esp   # DEAD CODE
        #APP
        #NO_APP
...
        pushl   %edx
        calll   ___asan_report_load4
        addl    $4, %esp   # DEAD CODE
        #APP
        #NO_APP
...
        pushl   %ecx
        calll   ___asan_report_load4
        addl    $4, %esp  # DEAD CODE
        #APP
        #NO_APP

LLVM can't do this easily because __asan_report_* isn't marked noreturn to
avoid tail merging it and hurting ASan debuggability. Perhaps we should fix the
debugging problem, and then LLVM can exploit the noreturn knowledge to fix this
issue.

Alternatively, we could just mark the entire __asan_report_* API as __stdcall
or __fastcall.</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>