[llvm-commits] CVS: llvm-gcc/gcc/config/rs6000/darwin.h rs6000.c
Chris Lattner
lattner at cs.uiuc.edu
Tue Jul 26 11:02:53 PDT 2005
Changes in directory llvm-gcc/gcc/config/rs6000:
darwin.h updated: 1.4 -> 1.5
rs6000.c updated: 1.2 -> 1.3
---
Log message:
Fix a problem where we were not handle 'long long' the same was as 'double'
in structs, which is required by the darwin ABI. This patch fixes part
of LLVM PR604: http://llvm.cs.uiuc.edu/PR604 , as well as GCC PR23067: http://llvm.cs.uiuc.edu/PR23067 , which is the corresponding mainline
GCC version of the problem.
---
Diffs of the changes: (+5 -4)
darwin.h | 6 +++---
rs6000.c | 3 ++-
2 files changed, 5 insertions(+), 4 deletions(-)
Index: llvm-gcc/gcc/config/rs6000/darwin.h
diff -u llvm-gcc/gcc/config/rs6000/darwin.h:1.4 llvm-gcc/gcc/config/rs6000/darwin.h:1.5
--- llvm-gcc/gcc/config/rs6000/darwin.h:1.4 Tue Jul 26 11:50:33 2005
+++ llvm-gcc/gcc/config/rs6000/darwin.h Tue Jul 26 13:02:42 2005
@@ -262,12 +262,12 @@
#define ALWAYS_PUSH_CONSTS_USING_REGS_P 1
/* This now supports a natural alignment mode */
-/* Darwin word-aligns FP doubles but doubleword-aligns 64-bit ints. */
+/* Darwin word-aligns FP doubles and 64-bit ints. */
#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \
(TARGET_ALIGN_NATURAL ? (COMPUTED) : \
- (TYPE_MODE (TREE_CODE (TREE_TYPE (FIELD)) == ARRAY_TYPE \
+ ((1 << (TYPE_MODE (TREE_CODE (TREE_TYPE (FIELD)) == ARRAY_TYPE \
? get_inner_array_type (FIELD) \
- : TREE_TYPE (FIELD)) == DFmode \
+ : TREE_TYPE (FIELD))) & ((1 << DFmode)|(1 << DImode))) \
? MIN ((COMPUTED), 32) : (COMPUTED)))
/* The maximum alignment for this target (according to LLVM) is 4 bytes,
Index: llvm-gcc/gcc/config/rs6000/rs6000.c
diff -u llvm-gcc/gcc/config/rs6000/rs6000.c:1.2 llvm-gcc/gcc/config/rs6000/rs6000.c:1.3
--- llvm-gcc/gcc/config/rs6000/rs6000.c:1.2 Tue Jul 26 11:50:33 2005
+++ llvm-gcc/gcc/config/rs6000/rs6000.c Tue Jul 26 13:02:42 2005
@@ -2108,7 +2108,8 @@
while (field != NULL && TREE_CODE (field) != FIELD_DECL)
field = TREE_CHAIN (field);
- if (field == NULL || field == type || DECL_MODE (field) != DFmode)
+ if (field == NULL || field == type
+ || (DECL_MODE (field) != DFmode && DECL_MODE(field) != DImode))
return MAX (computed, specified);
return MAX (MAX (computed, specified), 64);
More information about the llvm-commits
mailing list