https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95663
--- Comment #4 from John Zwinck <jzwinck at gmail dot com> --- Richard Biener said: > Note it will make a difference for very large objects (and thus very large > offsets added) which may end up accessing actually mapped memory so IMHO what > clang does by default is a security risk. I am a bit confused by this statement, as GCC turns what would have been a load from address zero into a load from a non-zero address. Here's a demo inspired by Mr Wakely's example: https://godbolt.org/z/EvMpyz Maybe I'm misreading the output, or you, but Clang's generated code looks safer to me.