I think the problem is that some of these optimizations aren&#x27;t just compiler makers being greedy, they&#x27;re actually a huge benefit. IMO what&#x27;s missing is the ability to mark areas &quot;unsafe&quot; -- IE, tell the compiler &quot;it&#x27;s ok to take advantage of certain optimizations here&quot; while marking other areas &quot;please don&#x27;t goof with this&quot; (ie, security critical code). You can kind of do this with pragmas, but not really.<p>Here&#x27;s a good example from the llvm blog: ( <a href="http:&#x2F;&#x2F;blog.llvm.org&#x2F;2011&#x2F;05&#x2F;what-every-c-programmer-should-know.html" rel="nofollow">http:&#x2F;&#x2F;blog.llvm.org&#x2F;2011&#x2F;05&#x2F;what-every-c-programmer-should-...</a> )<p>&gt; Signed integer overflow: If arithmetic on an &#x27;int&#x27; type (for example) overflows, the result is undefined. One example is that &quot;INT_MAX+1&quot; is not guaranteed to be INT_MIN. This behavior enables certain classes of optimizations that are important for some code. For example, knowing that INT_MAX+1 is undefined allows optimizing &quot;X+1 &gt; X&quot; to &quot;true&quot;. Knowing the multiplication &quot;cannot&quot; overflow (because doing so would be undefined) allows optimizing &quot;X*2&#x2F;2&quot; to &quot;X&quot;. While these may seem trivial, these sorts of things are commonly exposed by inlining and macro expansion. A more important optimization that this allows is for &quot;&lt;=&quot; loops like this:<p>&gt; for (i = 0; i &lt;= N; ++i) { ... }<p>&gt; In this loop, the compiler can assume that the loop will iterate exactly N+1 times if &quot;i&quot; is undefined on overflow, which allows a broad range of loop optimizations to kick in. On the other hand, if the variable is defined to wrap around on overflow, then the compiler must assume that the loop is possibly infinite (which happens if N is INT_MAX) - which then disables these important loop optimizations.