Bug 113338 - gcc(1): GNU gcc __thread as class member
Summary: gcc(1): GNU gcc __thread as class member
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: gnu (show other bugs)
Version: unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-04 18:10 UTC by Nathan Bates
Modified: 2016-06-12 16:34 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nathan Bates 2007-06-04 18:10:02 UTC
This pertains to GNU gcc Thread Local Storage.
http://gcc.gnu.org/onlinedocs/gcc-3.4.6/gcc/Thread_002dLocal.html#Thread_002dLocal

The storage class specifier "__thread" malfunctions
if the thread-local variable is a C++ static class member.
The variable apparently had a garbage value.
The same code works ok on Linux.

It will work ok on FreeBSD as an ordinary global variable (C extern linkage).

I used g++ 3.4.6 on FreeBSD 6.2.

How-To-Repeat: Write pthreads code where two threads
access a static class member in Thread Local Storage.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2007-07-27 12:05:31 UTC
Responsible Changed
From-To: freebsd-i386->freebsd-bugs

This does not sound i386-specific.
Comment 2 Pedro F. Giffuni freebsd_committer 2016-06-12 16:34:39 UTC
We don't really support gcc-3.4.6 (or FreeBSD 6.2) anymore, please check a newer version of FreeBSD with clang.