https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106064
--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> --- The IMHO UB case is for a != b when one address is at the start of one object and the other address is at the end of another one, which for zero sized objects is more often because the start address is the same as end address. For integral comparisons we try to be more conservative.