[llvm-commits] [dragonegg] r153404 - /dragonegg/trunk/src/Convert.cpp

Duncan Sands baldrick at free.fr
Sat Mar 24 21:43:50 PDT 2012


Author: baldrick
Date: Sat Mar 24 23:43:50 2012
New Revision: 153404

URL: http://llvm.org/viewvc/llvm-project?rev=153404&view=rev
Log:
The get_pointer_alignment function lost its max-align argument in gcc-4.7.
While there, produce a correct alignment if the gcc alignment is not a
multiple of an octet (!).

Modified:
    dragonegg/trunk/src/Convert.cpp

Modified: dragonegg/trunk/src/Convert.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Convert.cpp?rev=153404&r1=153403&r2=153404&view=diff
==============================================================================
--- dragonegg/trunk/src/Convert.cpp (original)
+++ dragonegg/trunk/src/Convert.cpp Sat Mar 24 23:43:50 2012
@@ -87,8 +87,13 @@
 /// expression, or 1 if the alignment is not known.
 static unsigned int getPointerAlignment(tree exp) {
   assert(POINTER_TYPE_P (TREE_TYPE (exp)) && "Expected a pointer type!");
-  unsigned int align = get_pointer_alignment(exp, BIGGEST_ALIGNMENT) / 8;
-  return align ? align : 1;
+  unsigned int align =
+#if (GCC_MINOR < 7)
+    get_pointer_alignment(exp, BIGGEST_ALIGNMENT);
+#else
+    get_pointer_alignment(exp);
+#endif
+  return align ? (align + 7) / 8 : 1;
 }
 
 /// getSSAPlaceholder - A fake value associated with an SSA name when the name





More information about the llvm-commits mailing list