https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70170
--- Comment #6 from Marek Polacek <mpolacek at gcc dot gnu.org> --- -fno-delete-null-pointer-checks seems to change nothing. But the case you mention is something I wanted to think about more before posting a real patch. I suppose I could add a check that the offset part of POINTER_PLUS_EXPR is >= 0, then we should be safe (pointer arithmetic is undefined if it overflows of course for both C/C++).