Marc Herbert wrote: [..] > In other words, by turning this off unconditionally at the global level, > the kernel could actually lose (surprise!) some performance. I expect the answer is that any compiler that does fail to convert this to defined behavior is not suitable for compiling the kernel. The issue is not "oh hey, this fixup in this case is tiny", it is "changing this precedent implicates a large flag day audit". I am certain this is one of many optimizations that the kernel is willing to sacrifice. Otherwise, the massive effort to remove undefined behavior from the kernel and allow for complier optimzations around that removal is called the "Rust for Linux" project.