Fix __attribute__((force_align_arg_pointer)) misalignment bug
authorErich Keane <erich.keane@intel.com>
Thu, 19 Apr 2018 14:27:05 +0000 (14:27 +0000)
committerErich Keane <erich.keane@intel.com>
Thu, 19 Apr 2018 14:27:05 +0000 (14:27 +0000)
commitb127a394041c2defbf44e1c52cb34bee643f3e5b
tree2bf3ddb33ce117f989fb078dda99a29db8d18c90
parent23bcf06a15e5ade824fdd6d3290a2a011d721dcc
Fix __attribute__((force_align_arg_pointer)) misalignment bug

The force_align_arg_pointer attribute was using a hardcoded 16-byte
alignment value which in combination with -mstack-alignment=32 (or
larger) would produce a misaligned stack which could result in crashes
when accessing stack buffers using aligned AVX load/store instructions.

Fix the issue by using the "stackrealign" function attribute instead
of using a hardcoded 16-byte alignment.

Patch By: Gramner

Differential Revision: https://reviews.llvm.org/D45812

llvm-svn: 330331
clang/lib/CodeGen/TargetInfo.cpp
clang/test/CodeGen/function-attributes.c