https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108283
--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Clang has a similar (same?) option to disable optimization around null pointers which is enabled for arm too. Just in the case of this source, gcc causes a trap to happen after deferencing a null pointer. Oh there is already a bug report opened about adding a warning too.