diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 12 | ||||
-rw-r--r-- | gcc/config/rs6000/darwin.h | 36 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000-protos.h | 2 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 33 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 13 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/powerpc/darwin-abi-10.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/powerpc/darwin-abi-11.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/powerpc/darwin-abi-3.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/powerpc/darwin-abi-6.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/powerpc/darwin-abi-7.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/powerpc/darwin-abi-8.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/powerpc/darwin-abi-9.c | 1 |
12 files changed, 77 insertions, 26 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9c6a836a38f..5ad5fb9a887 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,17 @@ 2006-10-31 Geoffrey Keating <geoffk@apple.com> + PR 23067 + * c-decl.c (start_struct): Don't create self-containing + structures. + * config/rs6000/rs6000.c (darwin_rs6000_special_round_type_align): + New. + * config/rs6000/rs6000-protos.h + (darwin_rs6000_special_round_type_align): New. + * config/rs6000/darwin.h (ADJUST_FIELD_ALIGN): Rewrite. + (ROUND_TYPE_ALIGN): Use darwin_rs6000_special_round_type_align. + +2006-10-31 Geoffrey Keating <geoffk@apple.com> + * toplev.c (compile_file): Call final_write_globals even if there have been errors. diff --git a/gcc/config/rs6000/darwin.h b/gcc/config/rs6000/darwin.h index 374f0014e13..b8cbdcc2dd1 100644 --- a/gcc/config/rs6000/darwin.h +++ b/gcc/config/rs6000/darwin.h @@ -374,26 +374,28 @@ do { \ /* Fix for emit_group_load (): force large constants to be pushed via regs. */ #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. */ -#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \ - (TARGET_ALIGN_NATURAL ? (COMPUTED) : \ - (TYPE_MODE (TREE_CODE (TREE_TYPE (FIELD)) == ARRAY_TYPE \ - ? get_inner_array_type (FIELD) \ - : TREE_TYPE (FIELD)) == DFmode \ - ? MIN ((COMPUTED), 32) : (COMPUTED))) +/* Compute field alignment. This is similar to the version of the + macro in the Apple version of GCC, except that version supports + 'mac68k' alignment, and that version uses the computed alignment + always for the first field of a structure. The first-field + behaviour is dealt with by + darwin_rs6000_special_round_type_align. */ +#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \ + (TARGET_ALIGN_NATURAL ? (COMPUTED) \ + : (COMPUTED) == 128 ? 128 \ + : MIN ((COMPUTED), 32)) /* Darwin 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) \ - && TARGET_ALIGN_NATURAL == 0 \ - ? rs6000_special_round_type_align (STRUCT, COMPUTED, SPECIFIED) \ - : (TREE_CODE (STRUCT) == VECTOR_TYPE \ - && ALTIVEC_VECTOR_MODE (TYPE_MODE (STRUCT))) \ - ? MAX (MAX ((COMPUTED), (SPECIFIED)), 128) \ +#define ROUND_TYPE_ALIGN(STRUCT, COMPUTED, SPECIFIED) \ + ((TREE_CODE (STRUCT) == RECORD_TYPE \ + || TREE_CODE (STRUCT) == UNION_TYPE \ + || TREE_CODE (STRUCT) == QUAL_UNION_TYPE) \ + && TARGET_ALIGN_NATURAL == 0 \ + ? darwin_rs6000_special_round_type_align (STRUCT, COMPUTED, SPECIFIED) \ + : (TREE_CODE (STRUCT) == VECTOR_TYPE \ + && ALTIVEC_VECTOR_MODE (TYPE_MODE (STRUCT))) \ + ? MAX (MAX ((COMPUTED), (SPECIFIED)), 128) \ : MAX ((COMPUTED), (SPECIFIED))) /* Specify padding for the last element of a block move between diff --git a/gcc/config/rs6000/rs6000-protos.h b/gcc/config/rs6000/rs6000-protos.h index 0cb5a50b773..3331c1137b7 100644 --- a/gcc/config/rs6000/rs6000-protos.h +++ b/gcc/config/rs6000/rs6000-protos.h @@ -114,6 +114,8 @@ extern rtx rs6000_machopic_legitimize_pic_address (rtx, enum machine_mode, #ifdef TREE_CODE extern unsigned int rs6000_special_round_type_align (tree, unsigned int, unsigned int); +extern unsigned int darwin_rs6000_special_round_type_align (tree, unsigned int, + unsigned int); extern void function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, tree, int, int); extern int function_arg_boundary (enum machine_mode, tree); diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 5d4b889e6d7..e82b6d59581 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -2591,7 +2591,7 @@ invalid_e500_subreg (rtx op, enum machine_mode mode) return false; } -/* Darwin, AIX increases natural record alignment to doubleword if the first +/* AIX increases natural record alignment to doubleword if the first field is an FP double while the FP fields remain word aligned. */ unsigned int @@ -2618,6 +2618,37 @@ rs6000_special_round_type_align (tree type, unsigned int computed, return align; } +/* Darwin increases record alignment to the natural alignment of + the first field. */ + +unsigned int +darwin_rs6000_special_round_type_align (tree type, unsigned int computed, + unsigned int specified) +{ + unsigned int align = MAX (computed, specified); + + if (TYPE_PACKED (type)) + return align; + + /* Find the first field, looking down into aggregates. */ + do { + tree field = TYPE_FIELDS (type); + /* Skip all non field decls */ + while (field != NULL && TREE_CODE (field) != FIELD_DECL) + field = TREE_CHAIN (field); + if (! field) + break; + type = TREE_TYPE (field); + while (TREE_CODE (type) == ARRAY_TYPE) + type = TREE_TYPE (type); + } while (AGGREGATE_TYPE_P (type)); + + if (! AGGREGATE_TYPE_P (type) && type != error_mark_node) + align = MAX (align, TYPE_ALIGN (type)); + + return align; +} + /* Return 1 for an operand in small memory on V.4/eabi. */ int diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 95f4301c7ed..64115a9c2e9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,14 @@ +2006-10-31 Geoffrey Keating <geoffk@apple.com> + + PR 23067 + * gcc.target/powerpc/darwin-abi-3.c: Remove XFAIL. + * gcc.target/powerpc/darwin-abi-6.c: Remove XFAIL. + * gcc.target/powerpc/darwin-abi-7.c: Remove XFAIL. + * gcc.target/powerpc/darwin-abi-8.c: Remove XFAIL. + * gcc.target/powerpc/darwin-abi-9.c: Remove XFAIL. + * gcc.target/powerpc/darwin-abi-10.c: Remove XFAIL. + * gcc.target/powerpc/darwin-abi-11.c: Remove XFAIL. + 2006-10-31 Eric Christopher <echristo@apple.com> Falk Hueffner <falk@debian.org> @@ -6,7 +17,7 @@ * gcc.dg/builtin-bswap-3.c: New. * gcc.dg/builtin-bswap-4.c: New. * gcc.dg/builtin-bswap-5.c: New. - * gcc.dg/i386/builtin-bswap-1.c: New. + * gcc.target/i386/builtin-bswap-1.c: New. 2006-10-31 Geoffrey Keating <geoffk@apple.com> diff --git a/gcc/testsuite/gcc.target/powerpc/darwin-abi-10.c b/gcc/testsuite/gcc.target/powerpc/darwin-abi-10.c index 0247c476d67..68540b8a162 100644 --- a/gcc/testsuite/gcc.target/powerpc/darwin-abi-10.c +++ b/gcc/testsuite/gcc.target/powerpc/darwin-abi-10.c @@ -1,6 +1,5 @@ /* { dg-do compile { target powerpc*-*-darwin* } } */ /* { dg-require-effective-target ilp32 } */ -/* { dg-xfail-if "" { powerpc*-*-darwin* } } */ /* { dg-options "-Wno-long-long" } */ struct b diff --git a/gcc/testsuite/gcc.target/powerpc/darwin-abi-11.c b/gcc/testsuite/gcc.target/powerpc/darwin-abi-11.c index bc5f50140ff..5d01572a8ba 100644 --- a/gcc/testsuite/gcc.target/powerpc/darwin-abi-11.c +++ b/gcc/testsuite/gcc.target/powerpc/darwin-abi-11.c @@ -1,6 +1,5 @@ /* { dg-do compile { target powerpc*-*-darwin* } } */ /* { dg-require-effective-target ilp32 } */ -/* { dg-xfail-if "" { powerpc*-*-darwin* } } */ /* { dg-options "-Wno-long-long" } */ struct A diff --git a/gcc/testsuite/gcc.target/powerpc/darwin-abi-3.c b/gcc/testsuite/gcc.target/powerpc/darwin-abi-3.c index 008ea46d524..021abc8fe4d 100644 --- a/gcc/testsuite/gcc.target/powerpc/darwin-abi-3.c +++ b/gcc/testsuite/gcc.target/powerpc/darwin-abi-3.c @@ -1,6 +1,5 @@ /* { dg-do compile { target powerpc*-*-darwin* } } */ /* { dg-require-effective-target ilp32 } */ -/* { dg-xfail-if "" { powerpc*-*-darwin* } } */ /* { dg-options "-Wno-long-long" } */ struct f { diff --git a/gcc/testsuite/gcc.target/powerpc/darwin-abi-6.c b/gcc/testsuite/gcc.target/powerpc/darwin-abi-6.c index 4d80187468e..1892e15bcee 100644 --- a/gcc/testsuite/gcc.target/powerpc/darwin-abi-6.c +++ b/gcc/testsuite/gcc.target/powerpc/darwin-abi-6.c @@ -1,6 +1,5 @@ /* { dg-do compile { target powerpc*-*-darwin* } } */ /* { dg-require-effective-target ilp32 } */ -/* { dg-xfail-if "" { powerpc*-*-darwin* } } */ /* { dg-options "-Wno-long-long" } */ struct a diff --git a/gcc/testsuite/gcc.target/powerpc/darwin-abi-7.c b/gcc/testsuite/gcc.target/powerpc/darwin-abi-7.c index d9ecee97b83..8af61ddacb3 100644 --- a/gcc/testsuite/gcc.target/powerpc/darwin-abi-7.c +++ b/gcc/testsuite/gcc.target/powerpc/darwin-abi-7.c @@ -1,6 +1,5 @@ /* { dg-do compile { target powerpc*-*-darwin* } } */ /* { dg-require-effective-target ilp32 } */ -/* { dg-xfail-if "" { powerpc*-*-darwin* } } */ /* { dg-options "-Wno-long-long" } */ struct b diff --git a/gcc/testsuite/gcc.target/powerpc/darwin-abi-8.c b/gcc/testsuite/gcc.target/powerpc/darwin-abi-8.c index b8e0c4d1f3e..eac0d12d188 100644 --- a/gcc/testsuite/gcc.target/powerpc/darwin-abi-8.c +++ b/gcc/testsuite/gcc.target/powerpc/darwin-abi-8.c @@ -1,6 +1,5 @@ /* { dg-do compile { target powerpc*-*-darwin* } } */ /* { dg-require-effective-target ilp32 } */ -/* { dg-xfail-if "" { powerpc*-*-darwin* } } */ struct c { diff --git a/gcc/testsuite/gcc.target/powerpc/darwin-abi-9.c b/gcc/testsuite/gcc.target/powerpc/darwin-abi-9.c index 7f215df9bed..fa5bd017fec 100644 --- a/gcc/testsuite/gcc.target/powerpc/darwin-abi-9.c +++ b/gcc/testsuite/gcc.target/powerpc/darwin-abi-9.c @@ -1,6 +1,5 @@ /* { dg-do compile { target powerpc*-*-darwin* } } */ /* { dg-require-effective-target ilp32 } */ -/* { dg-xfail-if "" { powerpc*-*-darwin* } } */ /* { dg-options "-Wno-long-long" } */ struct b |