The process of hardening the kernel can benefit in a number of ways from
support by the compiler. In recent years, the Kernel Self Protection Project has brought
this support from the grsecurity/PaX
patch set into the kernel in the 
form of GCC
plugins; LWN looked into that process back
in 2017.  A recent discussion has highlighted the fact that the use of
GCC plugins brings disadvantages
as well, and some developers would prefer to see those plugins replaced.
Source: LWN.net – [$] The future of GCC plugins in the kernel