https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120008
--- Comment #5 from H. Peter Anvin <hpa at zytor dot com> --- Having an -fkernel option would not be a bad thing, either; it could be used to hide anything the compiler does that is specific to kernel space. On a lot of platforms that would include stuff like __attribute__((interrupt)) and so on.