From: mrs Date: Thu, 8 Jun 2006 22:23:17 +0000 (+0000) Subject: PR target/26427 X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=commitdiff_plain;h=f13da317dd6b47dda5beac471ffe04cad10c06d3 PR target/26427 * config/darwin.c (darwin_asm_output_anchor): Disable -fsection-anchors on darwin for now. * config/darwin.h (TARGET_ASM_OUTPUT_ANCHOR): Likewise. * rs6000/rs6000.c (optimization_options): Likewise. testsuite: * gcc.dg/pr26427.c: Test to ensure that -fsection-anchors doesn't produce bad code on darwin. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@114498 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ca5851cc255..ce53bb29627 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2006-06-08 Mike Stump + + PR target/26427 + * config/darwin.c (darwin_asm_output_anchor): Disable + -fsection-anchors on darwin for now. + * config/darwin.h (TARGET_ASM_OUTPUT_ANCHOR): Likewise. + * rs6000/rs6000.c (optimization_options): Likewise. + 2006-06-08 Volker Reichelt PR target/27421 diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c index 5ffe744ef78..541b772a7a4 100644 --- a/gcc/config/darwin.c +++ b/gcc/config/darwin.c @@ -1524,6 +1524,8 @@ darwin_binds_local_p (tree decl) return default_binds_local_p_1 (decl, 0); } +#if 0 +/* See TARGET_ASM_OUTPUT_ANCHOR for why we can't do this yet. */ /* The Darwin's implementation of TARGET_ASM_OUTPUT_ANCHOR. Define the anchor relative to ".", the current section position. We cannot use the default one because ASM_OUTPUT_DEF is wrong for Darwin. */ @@ -1536,6 +1538,7 @@ darwin_asm_output_anchor (rtx symbol) fprintf (asm_out_file, ", . + " HOST_WIDE_INT_PRINT_DEC "\n", SYMBOL_REF_BLOCK_OFFSET (symbol)); } +#endif /* Set the darwin specific attributes on TYPE. */ void diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h index dcfab427bdc..941f60b357d 100644 --- a/gcc/config/darwin.h +++ b/gcc/config/darwin.h @@ -812,8 +812,6 @@ enum machopic_addr_class { goto DONE; \ } -#define TARGET_ASM_OUTPUT_ANCHOR darwin_asm_output_anchor - /* Experimentally, putting jump tables in text is faster on SPEC. Also this is needed for correctness for coalesced functions. */ @@ -852,6 +850,7 @@ void add_framework_path (char *); #define TARGET_POSIX_IO /* All new versions of Darwin have C99 functions. */ + #define TARGET_C99_FUNCTIONS 1 #define WINT_TYPE "int" @@ -859,7 +858,20 @@ void add_framework_path (char *); /* Every program on darwin links against libSystem which contains the pthread routines, so there's no need to explicitly call out when doing threaded work. */ + #undef GOMP_SELF_SPECS #define GOMP_SELF_SPECS "" +/* Darwin can't support anchors until we can cope with the adjustments + to size that ASM_DECLARE_OBJECT_NAME and ASM_DECLARE_CONSTANT_NAME + when outputting members of an anchor block and the linker can be + taught to keep them together or we find some other suitable + code-gen technique. */ + +#if 0 +#define TARGET_ASM_OUTPUT_ANCHOR darwin_asm_output_anchor +#else +#define TARGET_ASM_OUTPUT_ANCHOR NULL +#endif + #endif /* CONFIG_DARWIN_H */ diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 3a8e78a7f18..dd41f62a59c 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -1633,7 +1633,7 @@ optimization_options (int level ATTRIBUTE_UNUSED, int size ATTRIBUTE_UNUSED) /* Enable section anchors by default. Skip section anchors for Objective C and Objective C++ until front-ends fixed. */ - if (lang_hooks.name[4] != 'O') + if (!TARGET_MACHO && lang_hooks.name[4] != 'O') flag_section_anchors = 1; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 53c280a0dbf..344a9f072ae 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2006-06-08 Mike Stump + + PR target/26427 + * gcc.dg/pr26427.c: Test to ensure that -fsection-anchors doesn't + produce bad code on darwin. + 2006-06-08 Francois-Xavier Coudert PR fortran/27958 diff --git a/gcc/testsuite/gcc.dg/pr26427.c b/gcc/testsuite/gcc.dg/pr26427.c new file mode 100644 index 00000000000..3077221c7c7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr26427.c @@ -0,0 +1,24 @@ +/* { dg-warning "this target does not support" } */ +/* { dg-do run { target { *-*-darwin* } } } */ +/* { dg-options { -fsection-anchors -O } } */ +/* PR target/26427 */ + +struct a {}; +static const int d = 1; +static const struct a b = {}; +static const int c = 1; +int f(const int *, const struct a *, const int*, const int*); + +int g(void) { + return f(&c, &b, &d, &c); +} + +int f(const int *b, const struct a *c, const int *d, const int *e) { + return *b == *d; +} + +int main(void) { + if (!g()) + __builtin_abort(); + return 0; +}