https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121764

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #0)
> constant_pointer_difference has:
> /* For pointers p2 and p1 return p2 - p1 if the
>    difference is known and constant, otherwise return NULL.  */
> 
> While ptr_difference_const does:
> /* Returns true if addresses of E1 and E2 differ by a constant, false
>    otherwise.  If they do, E1 - E2 is stored in *DIFF.  */
> 
> 
> I suspect we could change the constant_pointer_difference usage to
> ptr_difference_const  one.  Let me try that.

So it is a little more complex due to constant_pointer_difference using more
walks. 

Because in the case of ptr_difference_const we already have the pointer_plus
case handled in match. While in the case of constant_pointer_difference we
don't so we need to walk to gat that.

Something for next year to merge both.

Reply via email to