<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/62325>62325</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
False/unsuppressible positive from UBSAN alignment check on _mm256_broadcast_sd
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
AndyEakins
</td>
</tr>
</table>
<pre>
I'm currently unable to run some code using `_mm256_broadcast_sd` with `-fsanitize=undefined`. The ubsan checks include 8 byte alignment which isn't consistent with other intrinsics (e.g. `_mm_load_sd`) and `__attribute__((no_sanitize("undefined")))` disables the other ubsan checks but leaves the failing alignment check.
[Example in Compiler Explorer](https://godbolt.org/#g:!((g:!((g:!((h:codeEditor,i:(filename:'1',fontScale:14,fontUsePx:'0',j:1,lang:c%2B%2B,selection:(endColumn:2,endLineNumber:11,positionColumn:2,positionLineNumber:11,selectionStartColumn:2,selectionStartLineNumber:11,startColumn:2,startLineNumber:11),source:'%23include+%3Ccstdio%3E%0A%23include+%3Cx86intrin.h%3E%0A%23include+%3Ccstdint%3E%0A%0A__attribute__((no_sanitize(%22undefined%22)))+int+main(int+argc,+char**+argv)%0A%7B%0A%09alignas(32)+uint8_t+test%5B32%5D+%3D+%7B1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8%7D%3B%0A%09__m256+x+%3D+_mm256_broadcast_sd(reinterpret_cast%3Cconst+double*%3E(%26test%5B1%5D))%3B%0A%09printf(%22%25d%5Cn%22,+_mm_extract_epi32(_mm_castps_si128(_mm256_castps256_ps128(x)),+0))%3B%0A%09return+0%3B%0A%7D'),l:'5',n:'0',o:'C%2B%2B+source+%231',t:'0')),k:38.008755681595,l:'4',n:'0',o:'',s:0,t:'0'),(g:!((h:compiler,i:(compiler:clang1600,deviceViewOpen:'1',filters:(b:'0',binary:'1',binaryObject:'1',commentOnly:'0',demangle:'0',directives:'0',execute:'0',intel:'0',libraryCode:'0',trim:'1'),flagsViewOpen:'1',fontScale:14,fontUsePx:'0',j:1,lang:c%2B%2B,libs:!(),options:'-mavx+-fsanitize%3Dundefined',selection:(endColumn:1,endLineNumber:1,positionColumn:1,positionLineNumber:1,selectionStartColumn:1,selectionStartLineNumber:1,startColumn:1,startLineNumber:1),source:1),l:'5',n:'0',o:'+x86-64+clang+16.0.0+(Editor+%231)',t:'0')),k:36.12402399490434,l:'4',n:'0',o:'',s:0,t:'0'),(g:!((h:output,i:(compilerName:'x86-64+gcc+12.2',editorid:1,fontScale:14,fontUsePx:'0',j:1,wrap:'1'),l:'5',n:'0',o:'Output+of+x86-64+clang+16.0.0+(Compiler+%231)',t:'0')),k:25.867220323500653,l:'4',n:'0',o:'',s:0,t:'0')),l:'2',n:'0',o:'',t:'0')),version:4)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0V1-Pm7oS_zTOi7XIDJiQhzwEdle60lX3Sr09r8jAJHFrbGSbbPZ8-iMDmw3dtN0jtVJE8Pyf8czPRjgnDxpxS3hB-P1KDP5o7Han25cH8U1qt6pN-7L9D4F1R5vBWtRevdBBi1oh9YbaQVNnOqSNaZEOTuoDJRmrug54VtXWiLYRzleuJRmjz9IfA_tu74SWXv6NJLkfdIt7qTFIRPT_R6RD7YSmzRGbb45K3aihRZrT-sUjFUoedIfa0-ejbI5UOk1g7WljtJPOj4zgxfgjWiq1t1I72ThKIMfoEM3RVcqIdoqKwIYK3Y6MSnhvZT14rCoCOYFcm-oSayDAW7gABDbzL2O0lS5UxVF_xNn9IpF68FShOM0SeyFVqNZbQqNcRNg9Ybv5yYuHs-h6hVRqWpqulwotfTj3yli0hN8TyI_e944kOwKPBB4Ppq2N8pGxh5GQHEZWPGXz48WRJLuwhw-t9MYSKOXIzfdSoRYdjqt1TGBNoNwb7T83QgVqnM6ELw7_d57E2CT2NbAJlEro4KshwKGYH6VDhY2XRk9-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