https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120903
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> --- I think that we could handle this by recognizing the full __fh_overlap pattern (but then we'd have to know the size of the objects involved). Note it isn't UB to have load4 be passed &r (by chance), not is it UB to compare the addresses as uintptr as done via __fh_overlap, so the UB access with calling memcpy isn't reached, instead we run into the trap(). Thus, optimizing this is invalid.