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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2026-11-23
           Keywords|                            |easyhack

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #2)
> 'f2' is probably missing store-motion, but you can optimize that in source
> just fine, which kernel folks prefer anyway, so make s->rc.range a register
> and store it once at the end of the function.

And there we have

(gdb) p debug_aff (&off1)
{
  type = sizetype
  offset = 0
  elements = {
    [0] = s_17(D) * 1
  }
}
$1 = void
(gdb) p debug_aff (&off2)
{
  type = sizetype
  offset = 8
  elements = {
    [0] = s_17(D) * 1, 
    [1] = (sizetype) k_18(D) * 512, 
    [2] = (long unsigned int) i_15 * 2
  }
}

but

  aff_combination_scale (&off1, -1);
  aff_combination_add (&off2, &off1);

  if (aff_comb_cannot_overlap_p (&off2, size1, size2))
    return false;

does not trigger, simply because

1175      if (diff->n != 0)
1176        return false;

the function could be improved by using range analysis on the coeffs,
possibly simply by fully evaluating the aff combination with range
arithmetic.  Should be reasonably "easy".

Reply via email to