Commit 6bc3403c by David Edelsohn

fix AIX struct/union/field alignment

From-SVN: r11866
parent 75c91bcd
...@@ -572,8 +572,9 @@ extern struct rs6000_cpu_select rs6000_select[]; ...@@ -572,8 +572,9 @@ extern struct rs6000_cpu_select rs6000_select[];
/* No data type wants to be aligned rounder than this. */ /* No data type wants to be aligned rounder than this. */
#define BIGGEST_ALIGNMENT 64 #define BIGGEST_ALIGNMENT 64
/* AIX aligns internal doubles in structures on word boundaries. */ /* AIX word-aligns FP doubles but doubleword-aligns 64-bit ints. */
#define BIGGEST_FIELD_ALIGNMENT 32 #define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \
(DECL_MODE (FIELD) != DFmode ? (COMPUTED) : MIN ((COMPUTED), 32))
/* Alignment of field after `int : 0' in a structure. */ /* Alignment of field after `int : 0' in a structure. */
#define EMPTY_FIELD_BOUNDARY 32 #define EMPTY_FIELD_BOUNDARY 32
...@@ -584,6 +585,16 @@ extern struct rs6000_cpu_select rs6000_select[]; ...@@ -584,6 +585,16 @@ extern struct rs6000_cpu_select rs6000_select[];
/* A bitfield declared as `int' forces `int' alignment for the struct. */ /* A bitfield declared as `int' forces `int' alignment for the struct. */
#define PCC_BITFIELD_TYPE_MATTERS 1 #define PCC_BITFIELD_TYPE_MATTERS 1
/* AIX increases natural record alignment to doubleword if the first
field is an FP double while the FP fields remain word aligned. */
#define ROUND_TYPE_ALIGN(STRUCT, COMPUTED, SPECIFIED) \
((TREE_CODE (STRUCT) == RECORD_TYPE \
|| TREE_CODE (STRUCT) == UNION_TYPE \
|| TREE_CODE (STRUCT) == QUAL_UNION_TYPE) \
&& DECL_MODE (TYPE_FIELDS (STRUCT)) == DFmode \
? MAX (MAX ((COMPUTED), (SPECIFIED)), BIGGEST_ALIGNMENT) \
: MAX ((COMPUTED), (SPECIFIED)))
/* Make strings word-aligned so strcpy from constants will be faster. */ /* Make strings word-aligned so strcpy from constants will be faster. */
#define CONSTANT_ALIGNMENT(EXP, ALIGN) \ #define CONSTANT_ALIGNMENT(EXP, ALIGN) \
(TREE_CODE (EXP) == STRING_CST \ (TREE_CODE (EXP) == STRING_CST \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment