<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/73218>73218</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            LLVM introduces calls to deprecated "bcmp"
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          RalfJung
      </td>
    </tr>
</table>

<pre>
    LLVM can simplify `memcmp` to `bcmp`:

https://github.com/llvm/llvm-project/blob/6367677c9d901f412934b4935c4341dc6d421d36/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp#L1599

However, according to `man bcmp`, that function is deprecated since 2001 and has been removed from POSIX in 2008:
```
STANDARDS
       4.3BSD.  This function is deprecated (marked as LEGACY in POSIX.1-2001); POSIX.1-2008 removes the specification of bcmp().
```

It seems problematic to replace calls to fully-supported-functions like `memcp` with deprecated functions like `bcmp`?

Looks like glibc addd a `__memcmpeq` function specifically so that GCC could use it instead of `bcmp`: https://sourceware.org/pipermail/libc-alpha/2021-September/131099.html. Maybe LLVM should do something similar?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUlE1v4zYQhn8NdRlYoEhFHwcdErvabuFti3VatKcFRY4sNpSoklQC__uCkpM4aHtYwyAxFD_ed_hwhPf6PCE25O6B3B0SsYTBuuarMP1Py3ROOqsuzfH4-xeQYgKvx9no_gKkoCOOcpxJQSHYGHdbRPg9oQdCr-0QwuzjGGsJa886DEuXSjsS1hrz_NrtZmf_QhkIaztjO8LaghdlUZayVjXN-jxjNc-7vOZ3Mud5pmShcpYpXtzso-O6Rycm31s3esLa34I2sT9dZR91txfG-FTOM2H8mN3V9a3YH-0LPqMjbA9CSuuUns5Xd6OY4NUh20MYRIB-mWTQdgLtQeHsUIqACryeJAKjNAMxKRiEhw5xAoejfUYFvbMj_PrL6fMfoKc4r3rPWUGv_zU8Pd7_fLj_ejhtIWy_POUPp0MK8Dho_38iCKtG4Z5QgfBw_OHT_f7PeNp6bJrtojrCasIfboeqq0YPYUDwM0rdaynW7W2_-WcVYXX6n3K39nMAjzh6mJ3tDI4iaBmT6HA2QiLIeANxoF-Muez8Ms_WBVS7VycejH7CV8RWwl50GG7d_XvqG33trZajtU_XOWejOwlCKQUiLvj2bQMY_44HvGXxzbQxF_B2u-hP-z1IuxgFi0fQAfTkAwoVk_KBfPiIu7eLk_giHKbWnQlrZz2jG4U2G69yJ8w8CMJaRlm2O-EccOwigG3GM1rX6RBGk8IXcekQ1lfoh1WHsuDtiGGIhHo9aiMc4W2iGq5qXosEm6yktGQV52UyNFgVlFLVd6KXKud9RvMSVaVYX6MqaJ_ohlHGs4xxWnGWlWnfY16qrOLYdXWXcZJTjMrT-NyinUR7v2BTcpZViREdGr8WEcYmfIH1I2Es1hTXrG-8W86e5NRoH_z7LkEHg1uF0VNwVi0S_TskH5BmG4EsWZxpvruyrJJiOVgl_xMAAP__jbGR4Q">