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

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Ah, row*stride is loop invariant and that saves us with -m32.  With -m64
we end up with

  <bb 3> [local count: 105119324]:
  row.0_1 = (unsigned int) row_13(D);
  _2 = row.0_1 * stride_14(D);

  <bb 4> [local count: 955630224]:
  # col_20 = PHI <col_17(6), 0(3)>
  col.1_3 = (unsigned int) col_20;
  _4 = _2 + col.1_3;
  _5 = (sizetype) _4;
  _6 = src_15(D) + _5;
  _7 = *_6;

which is "unfortuante" association of the (sizetype) conversion.  But
as the col addtition is unsigned it might overflow and we can't
associate the (sizetype) conversion but it makes the result non-affine.

A runtime versioning would be necessary, guaranteeing that _2 + col.1_3
never overflows.

Reply via email to