aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Stump <mrs@apple.com>2006-06-08 22:23:17 +0000
committerMike Stump <mrs@gcc.gnu.org>2006-06-08 22:23:17 +0000
commit23f99493bc7682649148bb438f9047bb8b59c5dc (patch)
tree61d23dcdc1b08a74306174e75f6690abbe62765a
parent07ea59afb113a51ecb305f3a94f9bebbcaffb6b6 (diff)
downloadgcc-23f99493bc7682649148bb438f9047bb8b59c5dc.zip
gcc-23f99493bc7682649148bb438f9047bb8b59c5dc.tar.gz
gcc-23f99493bc7682649148bb438f9047bb8b59c5dc.tar.bz2
re PR target/26427 (with -fsection-anchors with zero sized structs)
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. From-SVN: r114498
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config/darwin.c3
-rw-r--r--gcc/config/darwin.h16
-rw-r--r--gcc/config/rs6000/rs6000.c2
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gcc.dg/pr26427.c24
6 files changed, 56 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ca5851c..ce53bb2 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2006-06-08 Mike Stump <mrs@apple.com>
+
+ 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 <reichelt@igpm.rwth-aachen.de>
PR target/27421
diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c
index 5ffe744..541b772 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 dcfab42..941f60b 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 3a8e78a..dd41f62 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 53c280a..344a9f0 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2006-06-08 Mike Stump <mrs@apple.com>
+
+ 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 <coudert@clipper.ens.fr>
PR fortran/27958
diff --git a/gcc/testsuite/gcc.dg/pr26427.c b/gcc/testsuite/gcc.dg/pr26427.c
new file mode 100644
index 0000000..3077221
--- /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;
+}