https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84794
--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> --- One simple way of doing this is seeing if ptr_difference_const returns true and the difference is 0. I have not checked if this works but it just might.