https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96550
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> --- If FAIL is defined, your myfunc will always trigger undefined behavior if called, and as such anything can happen. Derefencing NULL is UB. If you are on an embedded system where there is memory mapped, you can use -fno-delete-null-pointer-checks (for some embedded targets it is even the default).