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

    <tr>
        <th>Summary</th>
        <td>
            clang: 18: continue to consume memory until OOM
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

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

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

<pre>
    Compiler Explorer: https://gcc.godbolt.org/z/vdP83ahfM

This small program, when compiled with clang (`-O0` is enough), clang quickly used up 16GB memory on my PC:
```
void test_memset_inline_0(
    void **const volatile restrict dst, char value) {
  __builtin_memset_inline(*dst, value, 0);
}

void test_memset_inline_1(void *dst, char value) {
 __builtin_memset_inline(dst, value, 1);
}

void test_memset_inline_4(void *dst, char value) {
 __builtin_memset_inline(dst, value, -60);
}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0k0-PmzwQxj_NcBklMmMC5MCBzb68p9XuoffIYC-4NXbqP9mmn76CJGq70qpSpUrIgPQ88_wYZkQIerRKNbB7gN1jJlKcnG_etPLR2ax38tIc3HzSRnn879vJOK888BanGE8BeAvUAXXjMGxHJ3tn4tb5Eaj7DtSd5UvNxfT6BOwRWHs9P006YJiFMXjybvRiBjrg26QsDtcgiW86TjgYYUcEqqFkm2cGJUMdUFmXxglov7iukq9JD1_MBVNQEtMJ8_L_B5zV7PwFncX5gi-HhfQKUbLbtb6enZYYVYjHWc1BxaO2Rlt1ZEvuqkBEXFVALVA7OBsinp0RURuFXoXo9RBRhrgSTcLjWZikgPYI1cO9yPHYJ22itr8HLTHU3sw33wHZ8n385oXq8df-fUScA9V3zj_AfMzyHiT_C5DiX4Bsyg96cv-dmWy43PO9yFSTl_uqKAuW59nU8B0fRF_VvGZDsaNelrLKa17Lqiiplq-ZbogRz1le5rwod2wrilyQ7EsqOO2GqoaCqVloszXmPC_jnekQkmrKPTGeGdErE9b9IVoHEoiWVfLNot_0aQxQMKNDDD8rRB2Naq5y3mJeL-fgbNQ2KYxueQ5pVvc5TjZqg8_PT1nypnm3fDpOqd8ObgbqloTbbXPy7rMaIlC3AgegbmX-EQAA___80TlS">