[PowerPC] Vector load/store builtins overstate alignment of pointers
authorNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Mon, 26 Nov 2018 14:35:38 +0000 (14:35 +0000)
committerNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Mon, 26 Nov 2018 14:35:38 +0000 (14:35 +0000)
commit2447baff848ec8bcb74575ed686a776fbfd1b8cc
tree2c2cef2df65d557105947cb8e3581cbfda22fffb
parent72c5fcf088a95a8e2ff9eda94d0e182618fbc4d1
[PowerPC] Vector load/store builtins overstate alignment of pointers

A number of builtins in altivec.h load/store vectors from pointers to scalar
types. Currently they just cast the pointer to a vector pointer, but expressions
like that have the alignment of the target type. Of course, the input pointer
did not have that alignment so this triggers UBSan (and rightly so).

This resolves https://bugs.llvm.org/show_bug.cgi?id=39704

Differential revision: https://reviews.llvm.org/D54787

llvm-svn: 347556
clang/lib/Headers/altivec.h
clang/test/CodeGen/builtins-ppc-altivec.c
clang/test/CodeGen/builtins-ppc-quadword.c
clang/test/CodeGen/builtins-ppc-vsx.c