aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Earnshaw <rearnsha@arm.com>2009-01-22 11:17:53 +0000
committerRichard Earnshaw <rearnsha@gcc.gnu.org>2009-01-22 11:17:53 +0000
commit963392680fda9affbde3be6ce9c1465c1c732e90 (patch)
tree907bdf8974d7dcb77d1741fcdf1154a03a3478d4
parent442dc742e44ddfdcd11c81be6ac562fbba62da4b (diff)
downloadgcc-963392680fda9affbde3be6ce9c1465c1c732e90.zip
gcc-963392680fda9affbde3be6ce9c1465c1c732e90.tar.gz
gcc-963392680fda9affbde3be6ce9c1465c1c732e90.tar.bz2
arm.h (DATA_ALIGNMENT): Align structures, unions and arrays to a word boundary.
* arm.h (DATA_ALIGNMENT): Align structures, unions and arrays to a word boundary. (LOCAL_ALIGNMENT): Similarly. From-SVN: r143566
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/arm/arm.h13
2 files changed, 19 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e503435..e8855f3 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2009-01-22 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm.h (DATA_ALIGNMENT): Align structures, unions and arrays to
+ a word boundary.
+ (LOCAL_ALIGNMENT): Similarly.
+
2009-01-22 Mark Shinwell <shinwell@codesourcery.com>
Joseph Myers <joseph@codesourcery.com>
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index f83aaba..fb636f3 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -564,6 +564,19 @@ extern int arm_arch_hwdiv;
&& (ALIGN) < BITS_PER_WORD * CONSTANT_ALIGNMENT_FACTOR) \
? BITS_PER_WORD * CONSTANT_ALIGNMENT_FACTOR : (ALIGN))
+/* Align definitions of arrays, unions and structures so that
+ initializations and copies can be made more efficient. This is not
+ ABI-changing, so it only affects places where we can see the
+ definition. */
+#define DATA_ALIGNMENT(EXP, ALIGN) \
+ ((((ALIGN) < BITS_PER_WORD) \
+ && (TREE_CODE (EXP) == ARRAY_TYPE \
+ || TREE_CODE (EXP) == UNION_TYPE \
+ || TREE_CODE (EXP) == RECORD_TYPE)) ? BITS_PER_WORD : (ALIGN))
+
+/* Similarly, make sure that objects on the stack are sensibly aligned. */
+#define LOCAL_ALIGNMENT(EXP, ALIGN) DATA_ALIGNMENT(EXP, ALIGN)
+
/* Setting STRUCTURE_SIZE_BOUNDARY to 32 produces more efficient code, but the
value set in previous versions of this toolchain was 8, which produces more
compact structures. The command line option -mstructure_size_boundary=<n>