https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83392
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- To me it looks like a sanopt bug. The -m32 version is missing 3 checks, lines 28/29/30, but those are all present before the sanopt pass: [ptr-overflow-sanitization-1.c:28:6] UBSAN_PTR ([ptr-overflow-sanitization-1.c:27:5] &MEM[(void *)[ptr-overflow-sanitization-1.c:27:7] &b + -9223372036854775807B], 9223372036854775805); for -m64 and corresponding -m32: [ptr-overflow-sanitization-1.c:28:6] UBSAN_PTR ([ptr-overflow-sanitization-1.c:27:5] &MEM[(void *)[ptr-overflow-sanitization-1.c:27:7] &b + 2147483649B], 2147483645); That is always &b + 0x8000....0001 and 0x7fff....fffd, so from the POV of the ptr overflow sanitization they should be handled the same.