Re: [PATCH] add support for placing variables in shared memory

2016-04-26 Thread Nathan Sidwell
On 04/25/16 13:49, Alexander Monakov wrote: On Mon, 25 Apr 2016, Nathan Sidwell wrote: acceptable? No, that really doesn't sound viable. You'd need to somehow take into account every instance where the compiler attempts to switch sections internally (.text/.data/.bss,

Re: [PATCH] add support for placing variables in shared memory

2016-04-25 Thread Alexander Monakov
On Mon, 25 Apr 2016, Nathan Sidwell wrote: > 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

Re: [PATCH] add support for placing variables in shared memory

2016-04-25 Thread Nathan Sidwell
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

Re: [PATCH] add support for placing variables in shared memory

2016-04-22 Thread Alexander Monakov
On Fri, 22 Apr 2016, Nathan Sidwell wrote: > On 04/21/16 10:25, Alexander Monakov wrote: > > On Thu, 21 Apr 2016, Nathan Sidwell wrote: > > > What is the rationale for a new attribute, rather than leveraging the > > > existing section(".shared") machinery? > > > > Section switching does not work

Re: [PATCH] add support for placing variables in shared memory

2016-04-22 Thread Nathan Sidwell
On 04/21/16 10:25, Alexander Monakov wrote: 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

Re: [PATCH] add support for placing variables in shared memory

2016-04-21 Thread Alexander Monakov
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")

Re: [PATCH] add support for placing variables in shared memory

2016-04-21 Thread Nathan Sidwell
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? + else if (current_function_decl &&

[PATCH] add support for placing variables in shared memory

2016-04-20 Thread Alexander Monakov
Allow using __attribute__((shared)) to place static variables in '.shared' memory space. Previously posted here: [gomp-nvptx 04/13] nvptx backend: add support for placing variables in shared memory https://gcc.gnu.org/ml/gcc-patches/2016-01/msg01546.html [gomp-nvptx] doc: document nvptx shared