https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66631
--- Comment #11 from Stas Sergeev <stsp at users dot sourceforge.net> --- (In reply to Andrew Pinski from comment #9) > 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? Alien code in place (think of wine/dosemu). > Also why can't you write your segfault handler in assembly when you fixup > the fs segment and then call the C functions? In principle - yes, but in practice - looking into a source - too much work. It is large, and it also uses a syscalls: sys_prctl(ARCH_SET_FS, eflags_fs_gs.fsbase); Do syscalls in asm too? :( Of course this all is possible, but... Should I really resort to always using -O1 till that also break? :( Let me ask you from the other side: why not simply to allow clobber also segregs? Improvement for everyone IMHO. clang did that for chromium it seems - likely a jit either. IMHO gcc should allow writing the specific things like signal handlers, interrupt handlers in embedded systems, etc - they all have suprises and deviations from ABI, yet gcc usually has an extensions to cover all these needs. Why to suddenly change that good practice?