This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/64748] OpenACC: "is not a variable" error with deviceptr()
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 10 Feb 2015 15:21:58 +0000
- Subject: [Bug c/64748] OpenACC: "is not a variable" error with deviceptr()
- Auto-submitted: auto-generated
- References: <bug-64748-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64748
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Thomas Schwinge from comment #3)
> (In reply to Jakub Jelinek from comment #2)
> > ??? threadprivate? That doesn't look even remotely similar to the deviceptr
> > clause, threadprivate in OpenMP is a declarative clause you put on variables
> > to turn them into TLS vars.
>
> I'm sorry that I didn't correctly memorize this OpenMP construct. So,
> considering:
>
> void f(int *a)
> {
> #pragma omp threadprivate (a)
> }
>
> ..., the error that GCC emits is actually correct:
>
> $ build-gcc/gcc/xgcc -Bbuild-gcc/gcc/ ../t.c -fopenmp
> ../t.c: In function 'f':
> ../t.c:3:27: error: 'a' is not a variable
> #pragma omp threadprivate (a)
> ^
Of course. You can't make a parameter threadprivate, nor you can make an
automatic variable threadprivate.