summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authoriains <iains@138bc75d-0d04-0410-961f-82ee72b054a4>2011-11-22 10:19:19 +0000
committeriains <iains@138bc75d-0d04-0410-961f-82ee72b054a4>2011-11-22 10:19:19 +0000
commite3ef604c3a6dd7012d4372d7dd2a9f12bb401fc8 (patch)
tree85b8f52e7ea0bebc7684ced5669af4e90f0ec345 /gcc
parent0bbd21790208f97e2ce112a0ab42187de61f3033 (diff)
downloadgcc-e3ef604c3a6dd7012d4372d7dd2a9f12bb401fc8.tar.gz
gcc:
* target.def (tm_clone_table_section): New hook. * doc/tm.texi.in (TARGET_ASM_TM_CLONE_TABLE_SECTION): Define. * doc/tm.texi: Regenerate. * varasm.c (dump_tm_clone_pairs): Use target tm_clone_table_section. * output.h (default_clone_table_section): New prototype. * config/darwin.h (TARGET_ASM_TM_CLONE_TABLE_SECTION): New. * config/darwin-protos.h (darwin_tm_clone_table_section): New prototype. * config/darwin.c (darwin_tm_clone_table_section): New. gcc/testsuite: * gcc.dg/tm/20100615.c: Adjust for Darwin tm_clone_table section name. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181613 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/config/darwin-protos.h1
-rw-r--r--gcc/config/darwin.c8
-rw-r--r--gcc/config/darwin.h4
-rw-r--r--gcc/doc/tm.texi4
-rw-r--r--gcc/doc/tm.texi.in2
-rw-r--r--gcc/output.h1
-rw-r--r--gcc/target.def7
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.dg/tm/20100615.c3
-rw-r--r--gcc/varasm.c10
11 files changed, 53 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8c776dc3c73..7b8b19fe518 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,14 @@
+2011-11-22 Iain Sandoe <iains@gcc.gnu.org>
+
+ * target.def (tm_clone_table_section): New hook.
+ * doc/tm.texi.in (TARGET_ASM_TM_CLONE_TABLE_SECTION): Define.
+ * doc/tm.texi: Regenerate.
+ * varasm.c (dump_tm_clone_pairs): Use target tm_clone_table_section.
+ * output.h (default_clone_table_section): New prototype.
+ * config/darwin.h (TARGET_ASM_TM_CLONE_TABLE_SECTION): New.
+ * config/darwin-protos.h (darwin_tm_clone_table_section): New prototype.
+ * config/darwin.c (darwin_tm_clone_table_section): New.
+
2011-11-21 Torvald Riegel <triegel@redhat.com>
* trans-mem.c (diagnose_tm_1): Print an expression instead of a
diff --git a/gcc/config/darwin-protos.h b/gcc/config/darwin-protos.h
index 21092af66e2..e0220864fac 100644
--- a/gcc/config/darwin-protos.h
+++ b/gcc/config/darwin-protos.h
@@ -58,6 +58,7 @@ extern int machopic_reloc_rw_mask (void);
extern section *machopic_select_section (tree, int, unsigned HOST_WIDE_INT);
extern section *darwin_function_section (tree, enum node_frequency, bool, bool);
+extern section *darwin_tm_clone_table_section (void);
extern void darwin_function_switched_text_sections (FILE *, tree, bool);
extern void darwin_unique_section (tree decl, int reloc);
diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c
index 7c33a533fff..b1038f40660 100644
--- a/gcc/config/darwin.c
+++ b/gcc/config/darwin.c
@@ -1265,6 +1265,14 @@ darwin_mergeable_constant_section (tree exp,
return readonly_data_section;
}
+section *
+darwin_tm_clone_table_section (void)
+{
+ return get_named_section (NULL,
+ "__DATA,__tm_clone_table,regular,no_dead_strip",
+ 3);
+}
+
int
machopic_reloc_rw_mask (void)
{
diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h
index 7ae751972f9..efff4c9a435 100644
--- a/gcc/config/darwin.h
+++ b/gcc/config/darwin.h
@@ -697,6 +697,10 @@ extern GTY(()) section * darwin_sections[NUM_DARWIN_SECTIONS];
#define TARGET_ASM_UNIQUE_SECTION darwin_unique_section
#undef TARGET_ASM_FUNCTION_RODATA_SECTION
#define TARGET_ASM_FUNCTION_RODATA_SECTION default_no_function_rodata_section
+
+#undef TARGET_ASM_TM_CLONE_TABLE_SECTION
+#define TARGET_ASM_TM_CLONE_TABLE_SECTION darwin_tm_clone_table_section
+
#undef TARGET_ASM_RELOC_RW_MASK
#define TARGET_ASM_RELOC_RW_MASK machopic_reloc_rw_mask
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index 10fd876fd09..c079ce29b7e 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -7090,6 +7090,10 @@ section names for mergeable constant data. Define this macro to override
the string if a different section name should be used.
@end deftypevr
+@deftypefn {Target Hook} {section *} TARGET_ASM_TM_CLONE_TABLE_SECTION (void)
+Return the section that should be used for transactional memory clone tables.
+@end deftypefn
+
@deftypefn {Target Hook} {section *} TARGET_ASM_SELECT_RTX_SECTION (enum machine_mode @var{mode}, rtx @var{x}, unsigned HOST_WIDE_INT @var{align})
Return the section into which a constant @var{x}, of mode @var{mode},
should be placed. You can assume that @var{x} is some kind of
diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in
index cebeb1fa777..d03d7f656a2 100644
--- a/gcc/doc/tm.texi.in
+++ b/gcc/doc/tm.texi.in
@@ -7013,6 +7013,8 @@ otherwise.
@hook TARGET_ASM_MERGEABLE_RODATA_PREFIX
+@hook TARGET_ASM_TM_CLONE_TABLE_SECTION
+
@hook TARGET_ASM_SELECT_RTX_SECTION
Return the section into which a constant @var{x}, of mode @var{mode},
should be placed. You can assume that @var{x} is some kind of
diff --git a/gcc/output.h b/gcc/output.h
index 2cabaaa4499..bc8c9d97825 100644
--- a/gcc/output.h
+++ b/gcc/output.h
@@ -638,6 +638,7 @@ extern section *default_elf_select_section (tree, int, unsigned HOST_WIDE_INT);
extern void default_unique_section (tree, int);
extern section *default_function_rodata_section (tree);
extern section *default_no_function_rodata_section (tree);
+extern section *default_clone_table_section (void);
extern section *default_select_rtx_section (enum machine_mode, rtx,
unsigned HOST_WIDE_INT);
extern section *default_elf_select_rtx_section (enum machine_mode, rtx,
diff --git a/gcc/target.def b/gcc/target.def
index 62bd06e976f..f5a5d54904a 100644
--- a/gcc/target.def
+++ b/gcc/target.def
@@ -305,6 +305,13 @@ section names for mergeable constant data. Define this macro to override\n\
the string if a different section name should be used.",
const char *, ".rodata")
+/* Return the section to be used for transactional memory clone tables. */
+DEFHOOK
+(tm_clone_table_section,
+ "Return the section that should be used for transactional memory clone\
+ tables.",
+ section *, (void), default_clone_table_section)
+
/* Output a constructor for a symbol with a given priority. */
DEFHOOK
(constructor,
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 086c1fb7e6b..9e3d5c84361 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,9 @@
2011-11-22 Iain Sandoe <iains@gcc.gnu.org>
+ * gcc.dg/tm/20100615.c: Adjust for Darwin tm_clone_table section name.
+
+2011-11-22 Iain Sandoe <iains@gcc.gnu.org>
+
* gcc.misc-tests/gcov-16.c: Adjust scan-assembler for Darwin.
* gcc.misc-tests/gcov-17.c: Likewise.
* g++.dg/gcov/gcov-8.C: Likewise.
diff --git a/gcc/testsuite/gcc.dg/tm/20100615.c b/gcc/testsuite/gcc.dg/tm/20100615.c
index 3d9e4684e5d..26964d43367 100644
--- a/gcc/testsuite/gcc.dg/tm/20100615.c
+++ b/gcc/testsuite/gcc.dg/tm/20100615.c
@@ -3,7 +3,8 @@
/* Since the non TM version of new_node() gets optimized away, it
shouldn't appear in the clone table either. */
-/* { dg-final { scan-assembler-not "tm_clone_table" } } */
+/* { dg-final { scan-assembler-not "tm_clone_table" { target { ! *-*-darwin* } } } } */
+/* { dg-final { scan-assembler-not "__DATA,__tm_clone_table" { target *-*-darwin* } } } */
#define NULL 0
extern void *malloc (__SIZE_TYPE__);
diff --git a/gcc/varasm.c b/gcc/varasm.c
index cfbb9ca1f2e..2c31af91b9a 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -5961,7 +5961,7 @@ dump_tm_clone_pairs (VEC(tm_alias_pair,heap) *tm_alias_pairs)
if (!switched)
{
- switch_to_section (get_named_section (NULL, ".tm_clone_table", 3));
+ switch_to_section (targetm.asm_out.tm_clone_table_section ());
assemble_align (POINTER_SIZE);
switched = true;
}
@@ -5973,6 +5973,14 @@ dump_tm_clone_pairs (VEC(tm_alias_pair,heap) *tm_alias_pairs)
}
}
+/* Provide a default for the tm_clone_table section. */
+
+section *
+default_clone_table_section (void)
+{
+ return get_named_section (NULL, ".tm_clone_table", 3);
+}
+
/* Helper comparison function for qsorting by the DECL_UID stored in
alias_pair->emitted_diags. */