http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50598
--- Comment #8 from Iain Sandoe <iains at gcc dot gnu.org> 2011-11-04 08:56:36 UTC --- the following also fails (for both c and c++): extern __thread int i; __thread int i; === - producing an empty asm file === gcc-4.6 produces: .globl ___emutls_v.i .data .align 2 ___emutls_v.i: .long 4 .long 4 .long 0 .long 0 .constructor .destructor .align 1 .subsections_via_symbols ==== I'm wondering if, when the variables are pruned - if they are emutls proxies, they need to check whether the parent var is prune-able. I looked at tree-emutls.c and it seems that the proxy variable should (in principle) be inheriting the attributes (including external and public) of the thread var. Perhaps they are missed in some update.