<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - Mismatching signature on __tgt_target calls for 32bit hosts"
   href="https://bugs.llvm.org/show_bug.cgi?id=41966">41966</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Mismatching signature on __tgt_target calls for 32bit hosts
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>OpenMP
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </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>Runtime Library
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>bucyril@ee.ethz.ch
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The signature used for the __tgt_target call used by Clang is:
int32_t __tgt_target(int64_t device_id, void *host_ptr, int32_t arg_num, void
**args_base, void **args, size_t *arg_sizes, int64_t *arg_types);

In CGOpenMPRuntime.cpp, line 2235:
<a href="https://github.com/llvm-mirror/clang/blob/1353fe814c52fd2eb0324cea1099ed79703896ff/lib/CodeGen/CGOpenMPRuntime.cpp#L2235">https://github.com/llvm-mirror/clang/blob/1353fe814c52fd2eb0324cea1099ed79703896ff/lib/CodeGen/CGOpenMPRuntime.cpp#L2235</a>

The signature used in libomptarget is:
int32_t __tgt_target(int64_t device_id, void *host_ptr, int32_t arg_num, void
**args_base, void **args, int64_t *arg_sizes, int64_t *arg_types);

in interface.cpp, line 217:
<a href="https://github.com/llvm-mirror/openmp/blob/665d5c5112ab6ee1cba56733ec3a1b37e86aa55b/libomptarget/src/interface.cpp#L217">https://github.com/llvm-mirror/openmp/blob/665d5c5112ab6ee1cba56733ec3a1b37e86aa55b/libomptarget/src/interface.cpp#L217</a>

These differ for 32bit hosts in the argument `arg_sizes`, because Clang
generates `size_t*`, while libomptarget expects `int64_t*`. This results in
unreasonably large allocations and a subsequent segfault when more than one
argument is used for the offloaded call.</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>