<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 --- - Tailcall forwards arguments with mismatching zero/signext parameter attributes"
   href="https://llvm.org/bugs/show_bug.cgi?id=26590">26590</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Tailcall forwards arguments with mismatching zero/signext parameter attributes
          </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, rnk@google.com
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>For example:

target datalayout = "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128"
target triple = "i386-unknown-linux-gnu"

declare void @g(i16 signext)
define void @f(i16 zeroext %x) {
entry:
  tail call void @g(i16 signext %x)
  ret void
}


llc will generate:

f:                                      # @f
    .cfi_startproc
# BB#0:                                 # %entry
    jmp    g                       # TAILCALL


Which means g()'s parameter doesn't get sign-extended to 32 bits as expected.


The problem is that MatchingStackOffset in X86ISelLowering.cpp only checks that
the arguments are at the same stack offset and have the same size. It should
also check the parameter attributes, but that is tricky since it has no
straight-forward way of getting at the caller's arguments.

I'm looking into this, but thought I'd file it in the meantime.</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>