From nobody@FreeBSD.org  Mon Jun  4 17:06:37 2007
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 18A6D16A46C
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  4 Jun 2007 17:06:37 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [69.147.83.33])
	by mx1.freebsd.org (Postfix) with ESMTP id 09BC513C46E
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  4 Jun 2007 17:06:37 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l54H6aRq027780
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 4 Jun 2007 17:06:36 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id l54H6a7e027778;
	Mon, 4 Jun 2007 17:06:36 GMT
	(envelope-from nobody)
Message-Id: <200706041706.l54H6a7e027778@www.freebsd.org>
Date: Mon, 4 Jun 2007 17:06:36 GMT
From: Nathan Bates<nathanbates99@yahoo.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: GNU gcc __thread as class member
X-Send-Pr-Version: www-3.0

>Number:         113338
>Category:       gnu
>Synopsis:       gcc(1): GNU gcc __thread as class member
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jun 04 17:10:02 GMT 2007
>Closed-Date:    
>Last-Modified:  Tue Jan 20 01:11:01 UTC 2009
>Originator:     Nathan Bates
>Release:        6.2
>Organization:
>Environment:
FreeBSD amd64.intra.net 6.2-RELEASE FreeBSD 6.2-RELEASE #0: Fri Jan 12 11:05:30 UTC 2007     root@dessler.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP  i386

>Description:
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.

>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-i386->freebsd-bugs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Fri Jul 27 11:05:31 UTC 2007 
Responsible-Changed-Why:  
This does not sound i386-specific. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=113338 
>Unformatted:
