From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17129 invoked by alias); 25 Apr 2016 14:47:54 -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 17049 invoked by uid 89); 25 Apr 2016 14:47:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=Couldnt, Couldn't, Hx-languages-length:1297, H*Ad:U*nathan X-HELO: mail-qk0-f173.google.com Received: from mail-qk0-f173.google.com (HELO mail-qk0-f173.google.com) (209.85.220.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 25 Apr 2016 14:47:52 +0000 Received: by mail-qk0-f173.google.com with SMTP id q76so47893227qke.2 for ; Mon, 25 Apr 2016 07:47:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:cc:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=PYrRT0y3EJT0LCQp7eH3yIZnuNgHIVA6TkViCybDe70=; b=FEmEmBptwuxZh3lmc57FGkublX7K/WpOnxKXVAK3WeEqzRp6EAY08lLomCYZcNySiM OEygncp2/fJS2mB2snozdwOkksYHZK5W/rCj2XAFW4zSmmLVGAVL66SV9Am4ZgJEQvxB F9z70ZHQP7UXDHHxQzICMWNcTNI8ZDDWKNu5MH2PP3Ck8ivWW7sWqoKygiGyt4rcSP6b OJtKrmUALkLQQM8PumiRFLfb5yij7LkQQUkuqRtNTl6lehLYqHpxVEFzDTCIIUuGqlhs 8wv5dgObbHmXGfePc4onzNPCePB1tGOhdN13VdYawVWuOFlzZVIM3cJ+r7TP7OxOULBd qBTg== X-Gm-Message-State: AOPr4FU7OyeLOnTFzEjKwpCc95JtliBZiPo7nwu5c+5BAbRSeZOjxVhtHHGg9BSDIvGkvA== X-Received: by 10.55.73.6 with SMTP id w6mr39679172qka.82.1461595669889; Mon, 25 Apr 2016 07:47:49 -0700 (PDT) Received: from ?IPv6:2601:181:c003:1930:a2a8:cdff:fe3e:b48? ([2601:181:c003:1930:a2a8:cdff:fe3e:b48]) by smtp.googlemail.com with ESMTPSA id g186sm7239092qke.49.2016.04.25.07.47.48 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 25 Apr 2016 07:47:48 -0700 (PDT) Subject: Re: [PATCH] add support for placing variables in shared memory To: Alexander Monakov References: <5718DCF0.5000808@acm.org> <571A226B.9020906@acm.org> Cc: gcc-patches@gcc.gnu.org From: Nathan Sidwell Message-ID: <571E2E0F.7040204@acm.org> Date: Mon, 25 Apr 2016 14:47:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2016-04/txt/msg01380.txt.bz2 On 04/22/16 10:04, Alexander Monakov wrote: > echo 'int v __attribute__((section("foo")));' | > x86_64-pc-linux-gnu-accel-nvptx-none-gcc -xc - -o /dev/null > :1:5: error: section attributes are not supported for this target Presumably it's missing a necessary hook? Couldn't such a hook check the section name is acceptable? >> Why can it not apply to variables of auto storage? I.e. function scope, >> function lifetime? That would seem to be a useful property. > > Because PTX does not support auto storage semantics for .shared data. It's > statically allocated at link time. I suppose it's not worth going through hoops to define such function-scoped variables if PTX isn't going to take advantage of that. >> What happens if an initializer is present, is it silently ignored? > > GCC accepts and reemits it in assembly output (if non-zero), and ptxas rejects > it ("syntax error"). ptx errors are inscrutable. It would be better for nvptx_assemble_decl_end to check if an initializer has been output and emit an error (you'll need to record the decl itself in the initializer structure to do that). Record the decl in nvptx_assemble_decl_begin if the symbol's data area is .shared, and then check in NADE? nathan