Re: [PATCH] D22543: [libunwind] Properly align _Unwind_Exception.

2016-07-19 Thread Ed Maste via cfe-commits
emaste accepted this revision.
emaste added a reviewer: emaste.
emaste added a comment.
This revision is now accepted and ready to land.

I've committed the alignment change to the copy of llvm libunwind in the 
FreeBSD base system now.


https://reviews.llvm.org/D22543



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D22543: [libunwind] Properly align _Unwind_Exception.

2016-07-19 Thread kled...@apple.com via cfe-commits
kledzik added a comment.

LGTM


https://reviews.llvm.org/D22543



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D22543: [libunwind] Properly align _Unwind_Exception.

2016-07-19 Thread Saleem Abdulrasool via cfe-commits
compnerd added a comment.

LGTM; we should make sure Nick is okay with it as well (for Darwin).  This 
should also make its way into 3.9 I think.


https://reviews.llvm.org/D22543



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D22543: [libunwind] Properly align _Unwind_Exception.

2016-07-19 Thread Eric Fiselier via cfe-commits
EricWF created this revision.
EricWF added reviewers: mclow.lists, compnerd.
EricWF added a subscriber: cfe-commits.

_Unwind_Exception is required to be double word aligned. Currently the struct 
is under aligned.

https://reviews.llvm.org/D22543

Files:
  include/unwind.h
  test/alignment.pass.cpp

Index: test/alignment.pass.cpp
===
--- /dev/null
+++ test/alignment.pass.cpp
@@ -0,0 +1,21 @@
+// -*- C++ -*-
+//===--===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===--===//
+
+// The Itanium ABI requires that _Unwind_Exception objects are "double-word
+// aligned".
+
+#include 
+
+struct MaxAligned {} __attribute__((aligned));
+static_assert(alignof(_Unwind_Exception) == alignof(MaxAligned), "");
+
+int main()
+{
+}
Index: include/unwind.h
===
--- include/unwind.h
+++ include/unwind.h
@@ -122,13 +122,16 @@
   uintptr_t private_1; // non-zero means forced unwind
   uintptr_t private_2; // holds sp that phase1 found for phase2 to use
 #ifndef __LP64__
-  // The gcc implementation of _Unwind_Exception used attribute mode on the
-  // above fields which had the side effect of causing this whole struct to
+  // The implementation of _Unwind_Exception uses an attribute mode on the
+  // above fields which has the side effect of causing this whole struct to
   // round up to 32 bytes in size. To be more explicit, we add pad fields
   // added for binary compatibility.
   uint32_t reserved[3];
 #endif
-};
+  // The Itanium ABI requires that _Unwind_Exception objects are "double-word
+  // aligned".  GCC has interpreted this to mean "use the maximum useful
+  // alignment for the target"; so do we.
+} __attribute__((__aligned__));
 
 typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn)
 (int version,


Index: test/alignment.pass.cpp
===
--- /dev/null
+++ test/alignment.pass.cpp
@@ -0,0 +1,21 @@
+// -*- C++ -*-
+//===--===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===--===//
+
+// The Itanium ABI requires that _Unwind_Exception objects are "double-word
+// aligned".
+
+#include 
+
+struct MaxAligned {} __attribute__((aligned));
+static_assert(alignof(_Unwind_Exception) == alignof(MaxAligned), "");
+
+int main()
+{
+}
Index: include/unwind.h
===
--- include/unwind.h
+++ include/unwind.h
@@ -122,13 +122,16 @@
   uintptr_t private_1; // non-zero means forced unwind
   uintptr_t private_2; // holds sp that phase1 found for phase2 to use
 #ifndef __LP64__
-  // The gcc implementation of _Unwind_Exception used attribute mode on the
-  // above fields which had the side effect of causing this whole struct to
+  // The implementation of _Unwind_Exception uses an attribute mode on the
+  // above fields which has the side effect of causing this whole struct to
   // round up to 32 bytes in size. To be more explicit, we add pad fields
   // added for binary compatibility.
   uint32_t reserved[3];
 #endif
-};
+  // The Itanium ABI requires that _Unwind_Exception objects are "double-word
+  // aligned".  GCC has interpreted this to mean "use the maximum useful
+  // alignment for the target"; so do we.
+} __attribute__((__aligned__));
 
 typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn)
 (int version,
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits