The code when it doesn&#x27;t crash has been reorganized by the compiler so the indirection doesn&#x27;t even happen until it is preparing the arguments for the printf, which is in an else after the NULL check. If you don&#x27;t need the value of a computation in one of two sides of an if statement and you know there are no legitimate side effects (I say &quot;legitimate&quot;, as crashing does not count) to the calculation, it makes sense to delay the execution of that logic until and unless you actually need it done. I thereby don&#x27;t find either result surprising here: it is just a demonstration of different optimization decisions and abilities of the two compilers.