This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/24455] [gomp] Trouble with threadprivate and extern
- From: "reichelt at igpm dot rwth-aachen dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Oct 2005 16:50:58 -0000
- Subject: [Bug c/24455] [gomp] Trouble with threadprivate and extern
- References: <bug-24455-1771@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from reichelt at igpm dot rwth-aachen dot de 2005-10-20 16:50 -------
Subject: Re: [gomp] Trouble with threadprivate and extern
On 20 Oct, dnovillo at redhat dot com wrote:
>
>
> ------- Comment #1 from dnovillo at redhat dot com 2005-10-20 16:45 -------
> Subject: Re: New: [gomp] Trouble with threadprivate and extern
>
> On Thursday 20 October 2005 12:34, reichelt at gcc dot gnu dot org wrote:
>
>> I'd expect that i is threadprivate in file1.c and file2.c.
>>
> But you have to mark it so in both places.
>
>> Am I misreading the OpenMP spec or is this a bug in the frontends?
>>
> I think you're misreading the spec, in 2.8.2. page 69, lines 4-6:
>
> "If a variable is specified in a threadprivate directive in one translation
> unit, it must be specified in a threadprivate directive in every
> translation unit in which it is declared."
Doesn't translation unit cover the include file?
But anyway. How should I mark it threadprivate in file2.c?
Adding "#pragma omp threadprivate (i)" before or after "int i;"
doesn't work.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24455