<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 - clang on sparc64 generates reference to unknown symbol __muloti4"
   href="https://bugs.llvm.org/show_bug.cgi?id=52043">52043</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang on sparc64 generates reference to unknown symbol __muloti4
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Sun
          </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>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>mikulas@artax.karlin.mff.cuni.cz
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>If you compile the following program with -O2, it will fail to link with
undefined reference to `__muloti4'

The bug happens with clang-14 on Sparc64, installed from Debian ports. It
doesn't happen on x86-64 or arm64.

The bug only happens with clang-14, it doesn't happen with older versions.

#include <stdio.h>

__attribute__((noinline)) int mul(__int128 a, __int128 b, __int128 *r)
{
        *r = (unsigned __int128)a * (unsigned __int128)b;
        return *r / a == b;
}

int main(void)
{
        __int128 r;
        int o;
        o = mul(2, 3, &r);
        printf("%d - %d\n", o, (int)r);
        return 0;
}</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>