https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66631
Andy Lutomirski <luto at mit dot edu> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |luto at mit dot edu
--- Comment #17 from Andy Lutomirski <luto at mit dot edu> ---
I'll chime in, possibly uselessly.
Before Linux 4.1, only CS was saved. (Unless you go *way* back.) In 4.1 or
newer, SS is saved, too.
In 64-bit code, DS and ES have no effect*, so I don't think it should affect
code gen.
FS and GS are weird, and they may get weirder when WRGSBASE and friends are
enabled, which will happen at some point.
Anyway, I tend to agree with Andrew here, I think: if you want to fiddle with
FS and GS, write a little asm wrapper around the C code.
* Except in an odd case on AMD processors that is mostly invisible to
userspace. On new enough kernels, it's completely invisible to userspace, and
I don't think it was ever visible without long jumps or such.