From patchwork Tue Nov 22 10:25:28 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 127053 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id C91A2B6FD7 for ; Tue, 22 Nov 2011 21:26:09 +1100 (EST) Received: (qmail 23275 invoked by alias); 22 Nov 2011 10:26:07 -0000 Received: (qmail 23262 invoked by uid 22791); 22 Nov 2011 10:26:06 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from c2beaomr06.btconnect.com (HELO mail.btconnect.com) (213.123.26.184) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 22 Nov 2011 10:25:31 +0000 Received: from host81-138-1-83.in-addr.btopenworld.com (EHLO thor.office) ([81.138.1.83]) by c2beaomr06.btconnect.com with ESMTP id FLQ90351; Tue, 22 Nov 2011 10:25:29 +0000 (GMT) Cc: GCC Patches , Richard Henderson Message-Id: <0203DB79-FEB8-4149-A428-1E3176A79232@sandoe-acoustics.co.uk> From: Iain Sandoe To: Mike Stump In-Reply-To: <4EC998A1.2090109@redhat.com> Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: [Patch] make it possible for the target to rename ".tm_clone_table" Date: Tue, 22 Nov 2011 10:25:28 +0000 References: <9B90055E-5374-4B02-8396-75502119DC89@sandoe-acoustics.co.uk> <89484C79-C459-4F0B-A2EF-53CBE78AA6B3@sandoe-acoustics.co.uk> <4EC7F8CF.4000804@redhat.com> <684BE489-AF8F-4110-8C23-4A362504B2FA@sandoe-acoustics.co.uk> <4EC998A1.2090109@redhat.com> X-Mirapoint-IP-Reputation: reputation=Good-1, source=Queried, refid=tid=0001.0A0B0302.4ECB7898.0092, actions=TAG X-Junkmail-Premium-Raw: score=8/50, refid=2.7.2:2011.11.22.94814:17:8.129, ip=81.138.1.83, rules=__MULTIPLE_RCPTS_CC_X2, __HAS_MSGID, __SANE_MSGID, __MSGID_APPLEMAIL, __TO_MALFORMED_2, __CT, __CTYPE_HAS_BOUNDARY, __CTYPE_MULTIPART, CTYPE_MULTIPART_NO_QUOTE, __CTYPE_MULTIPART_MIXED, __MIME_VERSION, __MIME_VERSION_APPLEMAIL, __BOUNCE_CHALLENGE_SUBJ, __BOUNCE_NDR_SUBJ_EXEMPT, __HAS_X_MAILER, __X_MAILER_APPLEMAIL, TXT_ATTACHED, __ANY_URI, __URI_NO_MAILTO, __URI_NO_WWW, __CP_URI_IN_BODY, BODYTEXTP_SIZE_3000_LESS, __MIME_TEXT_ONLY, RDNS_GENERIC_POOLED, RDNS_SUSP_GENERIC, __USER_AGENT_APPLEMAIL, RDNS_SUSP, MIME_TEXT_ONLY_MP_MIXED, MULTIPLE_RCPTS X-Junkmail-Signature-Raw: score=unknown, refid=str=0001.0A0B0202.4ECB7899.00CB, ss=1, re=0.000, fgs=0, ip=0.0.0.0, so=2011-07-25 19:15:43, dmn=2011-05-27 18:58:46, mode=multiengine X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On 21 Nov 2011, at 00:17, Richard Henderson wrote: > On 11/20/2011 05:34 AM, Iain Sandoe wrote: >> >> 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. >> * 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. > > Ok. This is what I committed (r181613)after accounting for: http://gcc.gnu.org/ml/gcc-patches/2011-11/msg02069.html and point 2 in http://gcc.gnu.org/ml/gcc-patches/2011-11/msg02155.html (and noting that I'd missed output.h from the original ChangeLog) Iain Index: gcc/doc/tm.texi =================================================================== --- gcc/doc/tm.texi (revision 181611) +++ gcc/doc/tm.texi (working copy) @@ -7090,6 +7090,10 @@ section names for mergeable constant data. Define 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 Index: gcc/doc/tm.texi.in =================================================================== --- gcc/doc/tm.texi.in (revision 181611) +++ gcc/doc/tm.texi.in (working copy) @@ -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 Index: gcc/target.def =================================================================== --- gcc/target.def (revision 181611) +++ gcc/target.def (working copy) @@ -305,6 +305,13 @@ section names for mergeable constant data. Define 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, Index: gcc/testsuite/gcc.dg/tm/20100615.c =================================================================== --- gcc/testsuite/gcc.dg/tm/20100615.c (revision 181611) +++ gcc/testsuite/gcc.dg/tm/20100615.c (working copy) @@ -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__); Index: gcc/varasm.c =================================================================== --- gcc/varasm.c (revision 181611) +++ gcc/varasm.c (working copy) @@ -5961,7 +5961,7 @@ dump_tm_clone_pairs (VEC(tm_alias_pair,heap) *tm_a 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_a } } +/* 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. */ Index: gcc/output.h =================================================================== --- gcc/output.h (revision 181611) +++ gcc/output.h (working copy) @@ -638,6 +638,7 @@ extern section *default_elf_select_section (tree, 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, Index: gcc/config/darwin-protos.h =================================================================== --- gcc/config/darwin-protos.h (revision 181611) +++ gcc/config/darwin-protos.h (working copy) @@ -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); Index: gcc/config/darwin.c =================================================================== --- gcc/config/darwin.c (revision 181611) +++ gcc/config/darwin.c (working copy) @@ -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) { Index: gcc/config/darwin.h =================================================================== --- gcc/config/darwin.h (revision 181611) +++ gcc/config/darwin.h (working copy) @@ -697,6 +696,10 @@ extern GTY(()) section * darwin_sections[NUM_DARWI #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