https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62307
Marc Glisse <glisse at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |missed-optimization --- Comment #1 from Marc Glisse <glisse at gcc dot gnu.org> --- -fsanitize=null seems to imply -fno-delete-null-pointer-checks, so I assume this is on purpose. It would actually be quite natural for the sanitizer to insert an extra check after every call to a returns_nonnull function, checking that the result is indeed !=0. Otherwise yes, sanopt is way too late for any other optimization to take place.