http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54129
--- Comment #6 from blucia at gmail dot com 2012-07-30 21:00:56 UTC --- Thanks for pointing out where that code is. I still think this is weird (i.e., possibly a bug) for two reasons: 1)Differs from Linux behavior. I'm sure lots of things differ though, so I understand pushing it off. 2)Inflexibility in how __thread vars are cleaned up. Is it possible to virtualize the emutls cleanup function? I understand that might be crazy and complex, so I understand pushing that off too. Thanks again for discussing this. I suspect you'll close it as not-a-bug, but it is disappointing that this portability problem exists.