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

    <tr>
        <th>Summary</th>
        <td>
            Clang and GCC behave inconsistently on constant parameters
        </td>
    </tr>

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

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

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

<pre>
    ```
#include <stdarg.h>
//#define va_arg(v, l) __builtin_va_arg(v, l)

void test(const va_list *a)
{
  va_arg(*a, unsigned long);
}
```
LLVM failed, as shown
https://godbolt.org/z/GTo7zfabM
![image](https://github.com/user-attachments/assets/e5ca7057-81c0-4296-af3b-dbde43fa404e)



GCC pass,
https://godbolt.org/z/Mr5WE5jf7

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMUk2P2yAQ_TX4ghzhwdj44MPG2exl91a1x2gw2GZFIDI41e6vr5wPpd1KVSUEI817zLyZhzHa0RvTErElYpfhkqYwt9MyLcB5poL-aEnFboftCHsiwK3v3aINJbyLSeM8bibCn-_p_eVwbQbrDT3jAeeRgDwT6Kgj0NDDQS3WJesPfydvn1zuc7CaJhMTAdkHH9P6mbMxUQJP-ADX22tAH8WugI4u_qJPUxf8uDL49k7a3YI_1b2-fn-jA1pn9MrHSOMUfvprckrpFAm_aRyDVsGlTVgr7j8J7F--hfpzQPV2H0VBxNYecTRE7AjIL3ybpkVt-nAksF-imXNMCfvpaHyKBPYYo7kERvRYM1HnsuhZXkJT5ThwlWulTckHLFlpvozu9_ul6-gJYyTQ_Z-Mt1n8eBbvQ32FZ7rluuENZqYtapBlCaKQ2dRCKUVV1aAHBShlURSMs6Epaln1sqrLzLbAoCwYaxgIUciNEMCrutGKSTVgr0jJzBGt2zh3Pq4dZDbGxbRFUVQAmUNlXLx7c25XVK6WMZKSrT6ID16yyZm2c-hHil7TVbQyE54NtX41j43J-OQ-aPD0Yib0iZ5wxqNJZo7ZMrv2H_tZC92e_DSHd9MnAvtLt-uKbg2fW_gVAAD__3cv-2s">