the post that brought this to my attention discussed how a security error in Linux was created by this "optimization".
The compiler didn't create a security bug by removing the null check. The bug was created by the programmer when he didn't check for null before dereferencing the pointer. Even with the check, the program contained a bug.