This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/64748] OpenACC: "is not a variable" error with deviceptr()


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]