https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66631
--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Stas Sergeev from comment #7) > (In reply to Andrew Pinski from comment #6) > > (In reply to Stas Sergeev from comment #5) > > > (In reply to Andrew Pinski from comment #4) > > > > (In reply to Stas Sergeev from comment #3) > > > > > The signal handler needs to do the following things: > > > > > 1. Restore segment registers (init_handler() func) > > > > > > > > Why are you doing this, that is the question I am trying to understand > > > > here. > > > > What signal handler is happening? > > > Ah, OK. > > > This is a jit compiler. > > > It uses segment registers at will, and it uses > > > a memory protection too, so the signal is SIGSEGV. > > > > That seems bogus usage really. And very unportable. Don't use segment > > registers at all. > Well, I can't, sorry. :) > Please note that clang is getting this fixed already it seems: Clang is not GCC. Really you should not be using the fs segment register for your own use as it is part of the ABI that is the TLS segment. Any other use it of it is outside of the ABI and will break everything else. Why can't you not use fs segment?