aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChung-Lin Tang <cltang@codesourcery.com>2010-10-12 18:35:59 +0000
committerChung-Lin Tang <cltang@gcc.gnu.org>2010-10-12 18:35:59 +0000
commit0c86e0dd926d3f688bdaeead1241a98851774ba9 (patch)
treec47daee6cca100d6c565b88cef46b6330ee12bb9
parent515fe073f6b6973655021153183ab3132a9f032c (diff)
downloadgcc-0c86e0dd926d3f688bdaeead1241a98851774ba9.zip
gcc-0c86e0dd926d3f688bdaeead1241a98851774ba9.tar.gz
gcc-0c86e0dd926d3f688bdaeead1241a98851774ba9.tar.bz2
arm.h (ARM_EXPAND_ALIGNMENT): Rename from DATA_ALIGNMENT and add COND parameter.
2010-10-12 Chung-Lin Tang <cltang@codesourcery.com> * config/arm/arm.h (ARM_EXPAND_ALIGNMENT): Rename from DATA_ALIGNMENT and add COND parameter. Update comments above. (DATA_ALIGNMENT): Use ARM_EXPAND_ALIGNMENT, with !optimize_size. (LOCAL_ALIGNMENT): Use ARM_EXPAND_ALIGNMENT, with !flag_conserve_stack. From-SVN: r165390
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config/arm/arm.h14
2 files changed, 18 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7a46d36..14e4cde 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2010-10-12 Chung-Lin Tang <cltang@codesourcery.com>
+
+ * config/arm/arm.h (ARM_EXPAND_ALIGNMENT): Rename from
+ DATA_ALIGNMENT and add COND parameter. Update comments above.
+ (DATA_ALIGNMENT): Use ARM_EXPAND_ALIGNMENT, with !optimize_size.
+ (LOCAL_ALIGNMENT): Use ARM_EXPAND_ALIGNMENT, with
+ !flag_conserve_stack.
+
2010-10-12 H.J. Lu <hongjiu.lu@intel.com>
PR bootstrap/45958
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index 55442f5..c8cbfa2 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -617,15 +617,21 @@ extern int arm_arch_hwdiv;
/* 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) \
+ definition. Increasing the alignment tends to introduce padding,
+ so don't do this when optimizing for size/conserving stack space. */
+#define ARM_EXPAND_ALIGNMENT(COND, EXP, ALIGN) \
+ (((COND) && ((ALIGN) < BITS_PER_WORD) \
&& (TREE_CODE (EXP) == ARRAY_TYPE \
|| TREE_CODE (EXP) == UNION_TYPE \
|| TREE_CODE (EXP) == RECORD_TYPE)) ? BITS_PER_WORD : (ALIGN))
+/* Align global data. */
+#define DATA_ALIGNMENT(EXP, ALIGN) \
+ ARM_EXPAND_ALIGNMENT(!optimize_size, EXP, ALIGN)
+
/* Similarly, make sure that objects on the stack are sensibly aligned. */
-#define LOCAL_ALIGNMENT(EXP, ALIGN) DATA_ALIGNMENT(EXP, ALIGN)
+#define LOCAL_ALIGNMENT(EXP, ALIGN) \
+ ARM_EXPAND_ALIGNMENT(!flag_conserve_stack, 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