[llvm-commits] CVS: llvm-gcc/gcc/config/rs6000/darwin.h rs6000-protos.h rs6000.c
Chris Lattner
lattner at cs.uiuc.edu
Tue Jul 26 09:50:44 PDT 2005
Changes in directory llvm-gcc/gcc/config/rs6000:
darwin.h updated: 1.3 -> 1.4
rs6000-protos.h updated: 1.1.1.2 -> 1.2
rs6000.c updated: 1.1.1.2 -> 1.2
---
Log message:
Sync up with mainline GCC for this code. This provides a minor bugfix
in cases like this C++ class:
struct X {
enum { A };
double D;
int X;
};
---
Diffs of the changes: (+20 -2)
darwin.h | 3 +--
rs6000-protos.h | 1 +
rs6000.c | 18 ++++++++++++++++++
3 files changed, 20 insertions(+), 2 deletions(-)
Index: llvm-gcc/gcc/config/rs6000/darwin.h
diff -u llvm-gcc/gcc/config/rs6000/darwin.h:1.3 llvm-gcc/gcc/config/rs6000/darwin.h:1.4
--- llvm-gcc/gcc/config/rs6000/darwin.h:1.3 Mon Jul 25 19:41:21 2005
+++ llvm-gcc/gcc/config/rs6000/darwin.h Tue Jul 26 11:50:33 2005
@@ -284,8 +284,7 @@
|| TREE_CODE (STRUCT) == QUAL_UNION_TYPE) \
&& TYPE_FIELDS (STRUCT) != 0 \
&& TARGET_ALIGN_NATURAL == 0 \
- && DECL_MODE (TYPE_FIELDS (STRUCT)) == DFmode \
- ? MAX (MAX ((COMPUTED), (SPECIFIED)), 64) \
+ ? rs6000_special_round_type_align (STRUCT, COMPUTED, SPECIFIED) \
: (TARGET_ALTIVEC && TREE_CODE (STRUCT) == VECTOR_TYPE) \
? MAX (MAX ((COMPUTED), (SPECIFIED)), 128) \
: MAX ((COMPUTED), (SPECIFIED)))
Index: llvm-gcc/gcc/config/rs6000/rs6000-protos.h
diff -u llvm-gcc/gcc/config/rs6000/rs6000-protos.h:1.1.1.2 llvm-gcc/gcc/config/rs6000/rs6000-protos.h:1.2
--- llvm-gcc/gcc/config/rs6000/rs6000-protos.h:1.1.1.2 Tue Jan 13 10:49:53 2004
+++ llvm-gcc/gcc/config/rs6000/rs6000-protos.h Tue Jul 26 11:50:33 2005
@@ -31,6 +31,7 @@
extern void rs6000_va_start (tree, rtx);
#endif /* TREE_CODE */
+extern unsigned int rs6000_special_round_type_align (tree, int, int);
extern struct rtx_def *rs6000_got_register (rtx);
extern struct rtx_def *find_addr_reg (rtx);
extern int any_operand (rtx, enum machine_mode);
Index: llvm-gcc/gcc/config/rs6000/rs6000.c
diff -u llvm-gcc/gcc/config/rs6000/rs6000.c:1.1.1.2 llvm-gcc/gcc/config/rs6000/rs6000.c:1.2
--- llvm-gcc/gcc/config/rs6000/rs6000.c:1.1.1.2 Tue Jan 13 10:49:53 2004
+++ llvm-gcc/gcc/config/rs6000/rs6000.c Tue Jul 26 11:50:33 2005
@@ -2096,6 +2096,24 @@
|| (op == XEXP (DECL_RTL (current_function_decl), 0))));
}
+/* Darwin, AIX increases natural record alignment to doubleword if the first
+field is an FP double while the FP fields remain word aligned. */
+
+unsigned int
+rs6000_special_round_type_align (tree type, int computed, int specified)
+{
+ tree field = TYPE_FIELDS (type);
+
+ /* Skip all non field decls */
+ while (field != NULL && TREE_CODE (field) != FIELD_DECL)
+ field = TREE_CHAIN (field);
+
+ if (field == NULL || field == type || DECL_MODE (field) != DFmode)
+ return MAX (computed, specified);
+
+ return MAX (MAX (computed, specified), 64);
+}
+
/* Return 1 if this operand is a valid input for a move insn. */
int
More information about the llvm-commits
mailing list