From patchwork Mon Oct 20 14:25:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Schmidt X-Patchwork-Id: 401152 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 23813140097 for ; Tue, 21 Oct 2014 01:27:23 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:references :in-reply-to:content-type; q=dns; s=default; b=Gojws//X3tpjipx3s d8LTdeyzX5SSWltaHqC/LvS+ao2Wn1fefLaqaeuEBNO/UzbBlTvMnbjAmBC7V7s8 m8PdNPszmqFYASmmffoTHxngMzlT75GhWME+MXEOBDLvWaAT+SAVNCn/kCIsVqZg uVa2LFNjANgKS6BvuWcuGZ5XqY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:references :in-reply-to:content-type; s=default; bh=w8nxHekJBbcvJy7wqY8XUEh R1Cs=; b=CnYacOybwtuvQqCprZZQnbwa7hZpjQpczf4ShVhVW8A9siHsGVyegKD UtbdP6SXBlE2d3KI7e/XWOidAYn6FDAjZSl/T+EznKrEfBgq/zRPlYudjCxREG/H tmBD0LmMEiKMEqm7G/AHWEBFgHWtvhOwcWd5ie50LmPbeF9V/stg= Received: (qmail 28859 invoked by alias); 20 Oct 2014 14:27:15 -0000 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 Received: (qmail 28849 invoked by uid 89); 20 Oct 2014 14:27:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, T_FROM_12LTRDOM autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 20 Oct 2014 14:27:05 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-03.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1XgDvJ-0004J4-K8 from Bernd_Schmidt@mentor.com for gcc-patches@gcc.gnu.org; Mon, 20 Oct 2014 07:27:01 -0700 Received: from [127.0.0.1] (137.202.0.76) by SVR-IES-FEM-03.mgc.mentorg.com (137.202.0.108) with Microsoft SMTP Server id 14.3.181.6; Mon, 20 Oct 2014 15:27:00 +0100 Message-ID: <54451B6A.10201@codesourcery.com> Date: Mon, 20 Oct 2014 16:25:46 +0200 From: Bernd Schmidt User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.8.0 MIME-Version: 1.0 To: GCC Patches Subject: The nvptx port [5/11+] Variable declarations References: <54451994.9070209@codesourcery.com> In-Reply-To: <54451994.9070209@codesourcery.com> ptx assembly follows rather different rules than what's typical elsewhere. We need a new hook to add a " };" string when we are finished outputting a variable with an initializer. Bernd gcc/ * target.def (decl_end): New hook. * varasm.c (assemble_variable_contents, assemble_constant_contents): Use it. * doc/tm.texi.in (TARGET_ASM_DECL_END): Add. * doc/tm.texi: Regenerate. ------------------------------------------------------------------------ Index: gcc/doc/tm.texi =================================================================== --- gcc/doc/tm.texi.orig +++ gcc/doc/tm.texi @@ -7575,6 +7575,11 @@ The default implementation of this hook when the relevant string is @code{NULL}. @end deftypefn +@deftypefn {Target Hook} void TARGET_ASM_DECL_END (void) +Define this hook if the target assembler requires a special marker to +terminate an initialized variable declaration. +@end deftypefn + @deftypefn {Target Hook} bool TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA (FILE *@var{file}, rtx @var{x}) A target hook to recognize @var{rtx} patterns that @code{output_addr_const} can't deal with, and output assembly code to @var{file} corresponding to Index: gcc/doc/tm.texi.in =================================================================== --- gcc/doc/tm.texi.in.orig +++ gcc/doc/tm.texi.in @@ -5412,6 +5412,8 @@ It must not be modified by command-line @hook TARGET_ASM_INTEGER +@hook TARGET_ASM_DECL_END + @hook TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA @defmac ASM_OUTPUT_ASCII (@var{stream}, @var{ptr}, @var{len}) Index: gcc/target.def =================================================================== --- gcc/target.def.orig +++ gcc/target.def @@ -127,6 +127,15 @@ when the relevant string is @code{NULL}. bool, (rtx x, unsigned int size, int aligned_p), default_assemble_integer) +/* Notify the backend that we have completed emitting the data for a + decl. */ +DEFHOOK +(decl_end, + "Define this hook if the target assembler requires a special marker to\n\ +terminate an initialized variable declaration.", + void, (void), + hook_void_void) + /* Output code that will globalize a label. */ DEFHOOK (globalize_label, Index: gcc/varasm.c =================================================================== --- gcc/varasm.c.orig +++ gcc/varasm.c @@ -1945,6 +1945,7 @@ assemble_variable_contents (tree decl, c else /* Leave space for it. */ assemble_zeros (tree_to_uhwi (DECL_SIZE_UNIT (decl))); + targetm.asm_out.decl_end (); } } @@ -3349,6 +3350,8 @@ assemble_constant_contents (tree exp, co /* Output the value of EXP. */ output_constant (exp, size, align); + + targetm.asm_out.decl_end (); } /* We must output the constant data referred to by SYMBOL; do so. */