<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=http://email.email.llvm.org/c/eJylVUuP4jgQ_jXhUmqUOITHIQfo3pbmtIfZ1R6R4xTgGceObIdu-tdv2YYAPUuvVitZxs5Xz6-qTGPaU53N87Ses_wly9cZK6UWamgxK5-db6WZHrLytwQ6bwfhYbvl3lvZDB63W8jYkhZXcq-xDbf5LGOr84pq38-mF5t0APgelVaX6w0CsM6qTZ5VL1n5kmflJ6B4BLBHQPkImD0CqkfA_BGw-BXIFi83N2X0Pm1BfBnFNxdWbs5xl9pDx6W-5eieuzW4AsghaHwbuSw_SbB_lSi_kOgthbGLn5krSC5jVZ-xZ8duzuV4ZuFaJDwCd8Ys-sFqyO-STodL-6XrXwfUMDgEf0AQpuu4brNyPcoKxfU-Yxta8PR7AU8dP75XBTuq8di8QezFrUfnp6Lv4ckA96MLY7-2xuhn1_Gvjax1S1kNOsbJPbxJpWCPHjhFbbEdun56W9INCh7SSnImyDnZtSB1GilpNCj5EyEZ3Hm04A0IhTz56LAz9jT9R9KO78b2jiaveu-6nOj_9ZTkOnPkSfDjAlN5K9vKa5_dm94M_sY98La16Bxxo4yAnTVd6B4yRP16Ak15NQjzGTQnj3B-Ec4xfxvLemE85Ge6Xsn42YV606NDti4Ckaxg1PRedvKDR5puwkn0GDuaDhkOvTu7_IO-KO4Cl0e0LijvhUhmxx5LvooFgPPUbNy2KaUwDuQYLffk4E36Q0qoQ5rOnlseDtd6HI1sw0yNGsFItQmDzpZkOnZxuXbyA7eeMh20D6mOQOq2I1eEcgXn8bmUIe1_nmM-eN-7oMZeae1N2xjlp8YSb68giBGHRBG1IbTouVTQyt0OLWqBKZHAAuUKsf_v-vRb1LfI-x4px6ARWeLkWuqkAIurMhRF-N6dqCTiIDVGyJkOwZDilXgS-irsuyD-6z5p67JdlSs-4YM_GFu_O1FWRb5gBVtMBqvqT66Jg6GZUvPRRanj5eept-YHCirMq3RuQEeHqixmi8mhzhc548Uy360ahqJZzOZNMxMz1qxE3qCoJoo3qFydaj75_y5lzXLG8qJglMeqnE-bplqJkuGumJXzcrnMZjnSv4SaBjuBxomto8lm2DsClXTeXUHuXBhHvETopVdY376Ae9Shd8fBBXoM40xCervGh20SQ61jnH8Dsh9fqQ>53147</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            clang++ generate aligned avx code cause coredump.
        </td>
    </tr>

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

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

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

<pre>
    ```C
#include<stdio.h>
struct __attribute__ ((aligned (64)))
S
{
  S()
  {
    A[0]=0;
    A[1]=0;
    A[2]=0;
    A[3]=0;
    A[4]=0;
    A[5]=0;
    A[6]=0;
    A[7]=0;
  };
  long long A[8];
};

int main()
{
  S* s1 = new S();
  S* s2 = new S();
  S* s3 = new S();
  printf("s1=%p,s2=%p,s3=%p",s1,s2,s3);
  return 0;
}
```
When use the command:
`clang++ -O1 -mavx512vl -mavx512bw align_test.cpp -o at`
or
`clang++ -O1 -mavx2 -mfma align_test.cpp -o at`
And  run the at will get a coredump.

Because will got a simd instruction like  the after to clean the memory.
```
vxorps %xmm0,%xmm0,%xmm0
vmovaps %zmm0,(%rdi)
```
But the memory address alloc from new, may not be 64 byte aligned.
I use the g++ to complie these code, g++ will not optimization the memory clean or use the vmovups.
The laster version gcc will use the c++17  standard new() operator with alignment parament.
`void* operator new[]( std::size_t count, std::align_val_t al );`

Use the https://godbolt.org/ can see more detail difference with gcc and clang.

I can reappearance the case in clang 7 and clang 11 in my mechine and some other version in https://godbolt.org/.










</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyVVU2P4jgQ_TXhUmqU2ITAIQfo3pbmtIfZ1R6Rk1TAM44d2Q7d9K_fcgwBeoZerWSFcl59vqoKlWlOZbJM43lO0pck3SSMS12rocGEPzvfSDM_JPyP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