From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 126476 invoked by alias); 21 Apr 2016 14:25:04 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 126466 invoked by uid 89); 21 Apr 2016 14:25:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: smtp.ispras.ru Received: from smtp.ispras.ru (HELO smtp.ispras.ru) (83.149.199.79) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 21 Apr 2016 14:25:02 +0000 Received: from [10.10.3.121] (unknown [83.149.199.91]) by smtp.ispras.ru (Postfix) with ESMTP id 9582B20406; Thu, 21 Apr 2016 17:25:00 +0300 (MSK) Date: Thu, 21 Apr 2016 14:25:00 -0000 From: Alexander Monakov To: Nathan Sidwell cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] add support for placing variables in shared memory In-Reply-To: <5718DCF0.5000808@acm.org> Message-ID: References: <5718DCF0.5000808@acm.org> User-Agent: Alpine 2.20 (LNX 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-SW-Source: 2016-04/txt/msg01180.txt.bz2 On Thu, 21 Apr 2016, Nathan Sidwell wrote: > On 04/20/16 12:58, Alexander Monakov wrote: > > Allow using __attribute__((shared)) to place static variables in '.shared' > > memory space. > > What is the rationale for a new attribute, rather than leveraging the existing > section(".shared") machinery? Section switching does not work at all on NVPTX in GCC at present. PTX assembly has no notion of different data sections, so the backend does not advertise section switching capability to the middle end. CUDA C does it via attributes too, and there's no point in diverging gratuitously I think. > > + else if (current_function_decl && !TREE_STATIC (decl)) > > + { > > + error ("%qE attribute only applies to non-stack variables", name); > > 'non-stack'? don't you mean 'static' or 'static storage'? I avoided using 'static' because it applies to external declarations as well. Other backends use "%qE attribute not allowed with auto storage class"; I'll be happy to switch to that for consistency. > Needs a test case. OK, will follow up with a testcase. Thanks. Alexander