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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=94356
           Severity|normal                      |enhancement

--- Comment #11 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
We just don't fold ptr < ptr that well:
  _1 = (sizetype) i_5(D);
  p_6 = &d[1] + _1;
  if (&MEM <char[3]> [(void *)&d + 1B] > p_6)

If we change d to be a pointer argument we get:
  p_5 = d_4(D) + 1;
  _1 = (sizetype) i_6(D);
  _10 = _1 + 1;
  p_7 = d_4(D) + _10;
  if (p_5 > p_7)
    goto <bb 4>; [INV]
  else
    goto <bb 3>; [INV]

But that is PR 94356 (well if change pointer from type char to being int or
something different).

Reply via email to