I don&#x27;t know about you guys, but as a reader unfamiliar with their codebase, when I see<p><pre><code>    return &amp;*rhs == NULL;
</code></pre>
I think exactly what the optimizer thought: &quot;Well, the address of an object can&#x27;t ever be NULL, so this expression always evaluates to false.&quot;<p>I don&#x27;t think code that does this is &quot;semi-legit&quot;; it&#x27;s completely counter-intuitive to abuse the expected semantics of unary `operator*` that way, even if the compiler did have no problem with it. You can&#x27;t expect a new member of the team to read this and not have fire alarms go off in their head.<p>As a side note, I also think that this optimization would be done by any compiler capable of basic pointer analysis. This isn&#x27;t really GCC being out-of-the-ordinary &quot;super-smart.&quot;