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

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
I can reproduce on aarch64 with -O2 -march=armv8.3-a+sve -fno-vect-cost-model
-fwrapv.  The reduction is

  <bb 3> [local count: 955630224]:
  # b_lsm.9_11 = PHI <_9(7), pretmp_42(6)>
  _4 = *_3;
  _5 = (signed int) _4;
  b.2_7 = (signed int) b_lsm.9_11;
  _15 = b.2_7 + -1;
  _8 = _15 - _5;
  _9 = (unsigned int) _8;

with -fwrapv and

  # b_lsm.9_11 = PHI <_7(7), pretmp_40(6)>
  _4 = *_3;
  _5 = (unsigned int) _4;
  _15 = b_lsm.9_11 + 4294967295;
  _7 = _15 - _5;

without.  So it seems the support for singed/unsigned converted reductions
is somehow broken.  At least for VLA vectors.

The epilog does

  # vect__9.22_59 = PHI <vect__9.22_58(3)>
  _60 = (vector([4,4]) signed int) vect__9.22_59;
  _61 = .REDUC_PLUS (_60);

I don't see where it goes wrong yet.

Reply via email to