<html>
    <head>
      <base href="http://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 --- - [NVPTX] compiling programs with indirect calls (via function pointers)"
   href="http://llvm.org/bugs/show_bug.cgi?id=17433">17433</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[NVPTX] compiling programs with indirect calls (via function pointers)
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>tools
          </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>llc
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>bart.goossens@telin.ugent.be
          </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>Created <span class=""><a href="attachment.cgi?id=11314" name="attach_11314" title="Test program with an indirect call that causes the bug">attachment 11314</a> <a href="attachment.cgi?id=11314&action=edit" title="Test program with an indirect call that causes the bug">[details]</a></span>
Test program with an indirect call that causes the bug

LLC (version 3.3svn, i686-pc-win32) with NVPTX back-end crashes when compiling
an LLVM program containing indirect calls.

>From the error message (see attached example) it seems that the back-end does
not know how to handle function pointers (despite the fact that the CUDA
compiler, NVCC supports them). The example compiles correctly with the x86
back-end, but not when targeting NVPTX.

According to the NVVM specification (see
<a href="http://docs.nvidia.com/cuda/nvvm-ir-spec/index.html">http://docs.nvidia.com/cuda/nvvm-ir-spec/index.html</a>), function pointers are
qualified by address space code addrspace(0) (=default), so not specifying an
address space should be fine. I tried to attach "callalign-metadata" to the
call, as described in the specification, but it did not make any difference.</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>