]> granicus.if.org Git - clang/commit
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)
commit8e661d572a3d3129bdc3395f728f541345dde616
tree30c66e9a842074624e990c2c2a0695d771b33216
parentf5169f5088072928b09f54545c79409b05058f5f
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@330331 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/TargetInfo.cpp
test/CodeGen/function-attributes.c