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

    <tr>
        <th>Summary</th>
        <td>
            clang 16 doesn't add the "crc" feature when using -march=armv8.2-a while it should
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          Romain-Geissler-1A
      </td>
    </tr>
</table>

<pre>
    Hi,

The following snippet:

```
#include <arm_acle.h>

int f()
{
 return __crc32cd(1, 1);
}
```

compiled with `-march=armv8.2-a` doesn't compile anymore with clang 16. It was working with clang 15 (and a `crc32cx w0, w8, x9` instruction was emitted), but fails with clang 16:

```
<source>:5:12: error: always_inline function '__crc32cd' requires target feature 'crc', but would be inlined into function 'f' that is compiled without support for 'crc'
    return __crc32cd(1, 1);
 ^
1 error generated.
Compiler returned: 1
```

Compiler explorer link: https://godbolt.org/z/K5saKnYWE

In practice, this make building the scudo library part of the compiler-rt runtime fail when trying to build with `-march=armv8.2-a`.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMVFGP4yYQ_jXkZZTIhjiOH_yQzTbt6d6qSlWfVhjGMV0M7gDnTX99hZ29ZtvqelJEMMx88_HNBzIEc3WILaueWPW8kSkOntqf_SiN2_6IJgSLtC1Pm87rW_uTYfzMimdWnNbxlwGh99b62bgrBGemCSMTp8cYdijuv_WTC-OUTRqBibOk8UUqi7uBiR8es4yL0DN-ZLy5L9dP6wQIYyIHLy-KlOBKM34sGT9DmWPF03v483-XX0blx8lY1DCbOAA7FNtRkhqYeJY0fjnu-FayQwHaY3CM1xHuCSDdbfSEa56y0l2hPOzgU4RZBpg9vWYhHncrYPwonQaZ66yU32AuMuP5mMe3JtcyLkRKKhrvFiwcTYyo85n4GboUoZfGho-V_0dqcQ4-kcKsrThVTJxKzsQJkMhTnkg7y1t4Mc4ah9Ant9ZnvH5QtwbCP5IhDBAlXTFCjzImwhynSDFev1OcfbIaOoQVUYNx0X_A7TNeHGQEE-BDG3yKENI0eYrQe3oAX9sO8H2dB1bdnVSuB4UrOiQZUe_W9fNalu54qLMU5Tfs8jUB3ybrCQmsca85a4hxCrkL_ML45ep1523ceboyfvmT8cvnKsjP7rdfP3j7k4OJpIpGYWYfBxNglK8IXTJWZwPFASGopD1Y05GkG0ySIvh-2bnLRluKQMlFM-JiDpgHdBDptkD4Fe7bFt9tdCt0Ixq5wbY81EKUh6poNkPbiKpsUDW63u9lWfRdeWyaum94c2g0VmJjWl5wUZRlUfDiyJvdvtZVU5cdokDeq4btCxylsTtrv4xZk40JIWFbNU1Zbqzs0Ibl4eHc4QzLJuM8v0PU5pxtl66B7QtrQgx_o0QTLbbvV-DhkkqtF30Y54tz-FejLsKkkHX5twwwD_lqmwhhyP7dJLLtPxpr4pC6nfIj45dM5P63ncj_jioyflnoB8Yvy_H-CgAA__9bUaTK">