https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95663
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to rguent...@suse.de from comment #8) > -fdelete-null-pointer-checks optimizes NULL pointer checks _after_ a > dereference. This case is first checking and then dereferencing. > GCC sees -fdelete-null-pointer-checks is just an option that says that it is ok to optimize null pointer dereferences. So, I don't see why we couldn't optimize this out. -fisolate-erroneous-paths-dereference is documented to add __builtin_trap in there instead of __builtin_unreachable, I'd say we want (by default) something that will add __builtin_unreachable in those cases instead.