https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125894
--- Comment #2 from H. Peter Anvin <hpa at zytor dot com> --- Obviously, nothing is ever "necessary." However, if you search for "NOP slide" or "NOP sled" on Google you will find a lot of hits. IBT (ENDBR) and shadow stacks can help prevent these in JOP and ROP scenarios, respectively, but it isn't certain that those are available to any specific user; for example, the Linux kernel is not able to implement shadow stacks on x86 without FRED, and I believe AMD x86 processors might not even have ENDBR. There are also users who want to absolutely maximize the performance, but opportunistically inserting poison where the code is padded has zero performance impact (depending on the specific nature of the instruction fetch front end, it might even have a beneficial impact, by terminating false branches.) Finally, speaking as someone who reads a lot of assembly output, I find it helpful for me as a programmer to immediately see what padding is unreachable and what is not.
