There&#x27;s no undefined behavior there. It&#x27;s just an example of why one might want the compiler to entirely ignore code you wrote.<p>If you want to use undefined behavior to elide the NULL checks, consider:<p><pre><code>    int computation(int *a, int *b) {
        if(a == NULL &amp;&amp; b == NULL) return 0;
        if(a == NULL) return *b;
        if(b == NULL) return *a;
        return ...something with *a and *b...;
    }

    ...elsewhere...
    int *a = malloc(sizeof(*a) * 1024);
    int *b = malloc(sizeof(*a) * 1024);
    for(int i = 0; i &lt; 1024; i++) {
        a[i] = i;
        b[i] = i * 2;
    }
    int c[1024];
    for(int i = 0; i &lt; 1024; i++)
        c = computation(a + i, b + i);
</code></pre>
The compiler is allowed to remove the NULL checks from an inlined computation here, since the code already dereferenced a and b in the initialization step. Failing to do so would make the code a lot slower, and this optimization seems completely reasonable to me.