From e8ab3bd3a5c53827dff622723f0834a8f641b1e9 Mon Sep 17 00:00:00 2001 From: Torok Edwin Date: Thu, 29 Apr 2010 06:43:12 +0000 Subject: [PATCH] Fix PR6910. Limit alignment in SmallVector 8, otherwise GCC assumes 16 byte alignment. opetaror new, and malloc only return 8-byte aligned memory on 32-bit Linux, which cause a crash if code is compiled with -O3 (or -ftree-vectorize) and some SmallVector code is vectorized. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102604 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ADT/SmallVector.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/llvm/ADT/SmallVector.h b/include/llvm/ADT/SmallVector.h index 2d79a029d01..18c8619bf93 100644 --- a/include/llvm/ADT/SmallVector.h +++ b/include/llvm/ADT/SmallVector.h @@ -59,7 +59,7 @@ protected: // number of union instances for the space, which guarantee maximal alignment. struct U { #ifdef __GNUC__ - char X __attribute__((aligned)); + char X __attribute__((aligned(8))); #else union { double D; -- 2.34.1