https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71962
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- If we do that, the question is when to (temporarily) enable the null pointer check deletion (unless disabled explicitly with -fno-delete-null-pointer-checks or from the target defaults, like AVR ...). Because I think there should be a difference between when some constant expression is being evaluated in constexpr contexts (then -fsanitize=undefined should not make a difference on those), and when it is just evaluated as constant expression as an optimization only (maybe_constant_value and the like for warning purposes, or during cp_fully_fold etc.). In the latter case, I think we should just not fold it if there are the sanitizations etc. Is ctx->quiet what is relevant, or something different? Perhaps even the UBSAN_* ifns should not be ignored if just in optimization?