https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113202
--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Why do you think this is a bug? I suspect this is due to `ptr-ptr` returns a signed value and max is (void*)-1 so it that returns a negative value and things just don't work.