&gt; In other words, perhaps we should fix compilers (and eventually the standard) to match reality instead of the other way around.<p>Without an analysis of the performance loss from removing this optimization, that would be irresponsible.<p>The authors of GCC were not stupid. They understood that these optimizations can be important for performance, and that&#x27;s why they implemented them. When this came up on the mailing list several years ago, Ian Lance Taylor found several places this optimization was kicking in in GCC itself.<p>It is <i>not</i> OK to just randomly avoid doing optimizations allowed by the C standard because they might trigger bugs. C depends on undefined behavior for performance. You depend on these compiler optimizations to get good performance out of the programs you run every day.