https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113551
--- Comment #17 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Yuxuan Shui from comment #16) > I see. but if it's undefined, why was the `if (dso)` only removed when > -fno-strict-overflow is enabled? and it still happens with > `-fno-delete-null-pointer-checks` So -fno-strict-overflow does -fno-wrapv-pointer so we can assume pointer arithmetic wraps now and then `a+1` could in theory wrap to nullptr. So many different hooks/options. It is better to use -fwrapv if you only want signed integer overflow being defined (as wrapping) rather than pointer arithmetic overflow being defined too.