Linus Torvalds writes: (Summary)
Other examples of where the kernel doesn't want the compiler to do
"the standard says this is undefined so I can take shortcuts" include:
"the standard says this is undefined so I can take shortcuts" include:
-fno-strict-aliasing: the standard is just wrong and full of shit,
and the misguided type-based aliasing can cause serious problems for
the kernel (but also other code)
the kernel (but also other code)
-fno-strict-overflow: again, this is a stupid optimization that purely depends on the compiler generating faster code by generating incorrect code.
incorrect code.
The one I'm actually upset about is when a compiler goes even *further* and does things that are NOT EVEN allowed by the paper standard, much less by real code.
standard, much less by real code.
The fact that clang by default enables "-fmerge-all-constants" behavior is just inexcusable.
the kernel (but also other code)
-fno-strict-overflow: again, this is a stupid optimization that purely depends on the compiler generating faster code by generating incorrect code.
incorrect code.
The one I'm actually upset about is when a compiler goes even *further* and does things that are NOT EVEN allowed by the paper standard, much less by real code.
standard, much less by real code.
The fact that clang by default enables "-fmerge-all-constants" behavior is just inexcusable.