[libunwind] r316991 - Merge r311574: ARM: explicitly specify the 8-byte alignment

Renato Golin via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 31 05:21:32 PDT 2017


Author: rengolin
Date: Tue Oct 31 05:21:32 2017
New Revision: 316991

URL: http://llvm.org/viewvc/llvm-project?rev=316991&view=rev
Log:
Merge r311574: ARM: explicitly specify the 8-byte alignment

Fixing the last libunwind failure on ARM.



Modified:
    libunwind/branches/release_50/include/unwind.h
    libunwind/branches/release_50/test/alignment.pass.cpp

Modified: libunwind/branches/release_50/include/unwind.h
URL: http://llvm.org/viewvc/llvm-project/libunwind/branches/release_50/include/unwind.h?rev=316991&r1=316990&r2=316991&view=diff
==============================================================================
--- libunwind/branches/release_50/include/unwind.h (original)
+++ libunwind/branches/release_50/include/unwind.h Tue Oct 31 05:21:32 2017
@@ -100,7 +100,7 @@ struct _Unwind_Control_Block {
   } pr_cache;
 
   long long int :0; /* Enforce the 8-byte alignment */
-};
+} __attribute__((__aligned__(8)));
 
 typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn)
       (_Unwind_State state,

Modified: libunwind/branches/release_50/test/alignment.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libunwind/branches/release_50/test/alignment.pass.cpp?rev=316991&r1=316990&r2=316991&view=diff
==============================================================================
--- libunwind/branches/release_50/test/alignment.pass.cpp (original)
+++ libunwind/branches/release_50/test/alignment.pass.cpp Tue Oct 31 05:21:32 2017
@@ -13,8 +13,16 @@
 
 #include <unwind.h>
 
-struct MaxAligned {} __attribute__((aligned));
-static_assert(alignof(_Unwind_Exception) == alignof(MaxAligned), "");
+// EHABI  : 8-byte aligned
+// itanium: largest supported alignment for the system
+#if defined(_LIBUNWIND_ARM_EHABI)
+static_assert(alignof(_Unwind_Control_Block) == 8,
+              "_Unwind_Control_Block must be double-word aligned");
+#else
+struct MaxAligned {} __attribute__((__aligned__));
+static_assert(alignof(_Unwind_Exception) == alignof(MaxAligned),
+              "_Unwind_Exception must be maximally aligned");
+#endif
 
 int main()
 {




More information about the cfe-commits mailing list