Content originally posted in LPCWare by starblue on Thu Mar 10 12:58:41 MST 2016
You are dereferencing a null pointer, which is undefined behavior. So the compiler is within its rights to generate whatever code it wants, and recent GCC versions have become quite aggressive at this (yes, people are complaining, mostly about signed overflow).
Its a bit unfortunate if you really want to access address 0, maybe you need to hide your bad intentions better, so the compiler doesn't notice.