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

    <tr>
        <th>Summary</th>
        <td>
            False positive -Wundefined-reinterpret-cast with SSE types?
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang:frontend,
            clang:diagnostics,
            false-positive
      </td>
    </tr>

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

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

<pre>
    Hi!

We are getting the `-Wundefined-reinterpret-cast` warning from the following code:
```cpp
typedef double __v2df __attribute__((__vector_size__(16)));

int main()
{
    double src[2] __attribute__((__aligned__(16)));
    __v2df dst{};
    *reinterpret_cast<__v2df*>(&src) = dst;
}
```

```
<source>:7:6: warning: dereference of type '__v2df *' that was reinterpret_cast from type 'double (*)[2]' has undefined behavior [-Wundefined-reinterpret-cast]
    *reinterpret_cast<__v2df*>(&src) = dst;
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

Repro: https://godbolt.org/z/fndoEq71P

Is this warning correct, or a false positive? Aren't both pointers pointing to `double`, therefore compatible types?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy1VE1zmzAQ_TXiorEHpADmwMGJ7WlvneaQo0egBaujICoJZ5Jf35UgjpNpcmoZiQ-tdvfteysaI5_rb4qwjKQ7km7n-wNQYYH24L0aeupPQEmRrh6mQUKnBpArC2rwYEcLftUK59FMn4QdwvbOmsfo0xmtzVNYao0EwpfouHce7TjOK_55BIxMpZkaDfR4PDPZ4UN4b1UzeTgeCdvgQAu03tijUy_zYlYQVi2D314XgQDpo1BD9KwWS7lsoXgt2ZxtSX7LSL77e0ahVY8lf5othFoQSyQCM5S7d0bCtld0HSNd_G52QRvh-5iqCEBYRQnfxUCXajDce96uq_y4yO-cmWwLISrfljgLnK_ahFcJFjqcQwvUdDRwjxDLpYQAiJUon_Do5OhH5Iu6i9NCYcS_DaTMRIYIJ3S-9Att4CTOyliKO77so3z3z4ijMUa-J-V_G5_r8hNGawLdJ-9HF3qfHXD0RjZG-7WxPX694OwGafa_y-zHtfd3hwoodzlSrbEWG5-wO4ocCtoJ7YCOximvzqj1gSJT2Omlp43xJ7RE2tz8Es-wCUd41itAxUh4RLETDB701jyOwqsgZVAW4R4SqLOiKPkm32Q8kTWXFa9E4pXXUB_epadfCUqfFOK5v9-_RZ6srj-wgnumZo0w8EPr8-tjhRz-inUflHMTurNDvimLNDnVaVV1actlV3Yia5tSFgK4aHLIy81NsSkSLRrQrsaGI4y1WsTux-5FeIPEpUDBlUUq0Q_GedW6N2PkeXXhmYXmTlTNUsayLGVZesM5W_OcsVQUZdUVVdaknNykgH8evQ41BKkTW8dymql3aNTKefdmFM6FPwxEqBhfTP5kbN0Kq43rhT7Dy5jE-utY_B9rybUt">