[Bug c/24455] New: [gomp] Trouble with threadprivate and extern
reichelt at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Thu Oct 20 16:34:00 GMT 2005
Compiling the following project with -fopenmp doesn't work:
file.h:
=======================================
extern int i;
#pragma omp threadprivate (i)
=======================================
file1.c:
=======================================
#include "file.h"
int main()
{
return i;
}
=======================================
file2.c:
=======================================
#include "file.h"
int i;
=======================================
For file2.c I get the following error message:
file2.c:2: error: non-thread-local declaration of 'i' follows thread-local
declaration
file.h:1: error: previous declaration of 'i' was here
Compiling the files as C++ files results in a linker failure:
/usr/bin/ld: i: TLS reference in /tmp/cceZCG1l.o mismatches non-TLS
definition in /tmp/ccBzZ3av.o section .bss
/tmp/ccBzZ3av.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
I'd expect that i is threadprivate in file1.c and file2.c.
Am I misreading the OpenMP spec or is this a bug in the frontends?
--
Summary: [gomp] Trouble with threadprivate and extern
Product: gcc
Version: unknown
Status: UNCONFIRMED
Keywords: wrong-code, rejects-valid, openmp
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: reichelt at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24455
More information about the Gcc-bugs
mailing list