https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120268
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> --- phiopt, where CSELIM is done might be the place to put this into. We might want to try simplifying the COND_EXPR ptr[i] != 0 ? 0 : ptr[i].