https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80258
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> --- This is not a bug, that is how TLS is designed. You shouldn't change threads in the middle of a function. If you do, you shouldn't use TLS, but something different; basically you are implementing your own threading library then and you are responsible for arranging that it works.