public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Alexander Monakov <amonakov@ispras.ru>
To: Nathan Sidwell <nathan@acm.org>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] add support for placing variables in shared memory
Date: Thu, 21 Apr 2016 14:25:00 -0000	[thread overview]
Message-ID: <alpine.LNX.2.20.1604211708150.20393@monopod.intra.ispras.ru> (raw)
In-Reply-To: <5718DCF0.5000808@acm.org>

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

  reply	other threads:[~2016-04-21 14:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-20 16:58 Alexander Monakov
2016-04-21 14:00 ` Nathan Sidwell
2016-04-21 14:25   ` Alexander Monakov [this message]
2016-04-22 13:09     ` Nathan Sidwell
2016-04-22 14:04       ` Alexander Monakov
2016-04-25 14:47         ` Nathan Sidwell
2016-04-25 17:49           ` Alexander Monakov
2016-04-26 13:06             ` Nathan Sidwell
2016-05-06 17:11 ` [PATCH v2] " Alexander Monakov
2016-05-09 13:39   ` Nathan Sidwell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LNX.2.20.1604211708150.20393@monopod.intra.ispras.ru \
    --to=amonakov@ispras.ru \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=nathan@acm.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).