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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
            Version|unknown                     |16.0
   Last reconfirmed|                            |2025-08-22
             Status|UNCONFIRMED                 |NEW

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed. The vectorizer goes wrong:
```
  <bb 3> [local count: 4294967269]:
  # d_29 = PHI <d_8(12), 0(2)>
  # ivtmp_39 = PHI <ivtmp_25(12), 16(2)>
  # vect_vec_iv_.15_31 = PHI <_13(12), { 0, 1, 2, 3 }(2)>
  # vectp_e.16_19 = PHI <vectp_e.16_38(12), e_6(2)>
  # ivtmp_18 = PHI <ivtmp_34(12), 0(2)>
  d_8 = d_29 + 1;
  _9 = (long unsigned int) d_29;
  _10 = _9 * 4;
  _11 = e_6 + _10;
  MEM <vector(4) int> [(int *)vectp_e.16_19] = vect_vec_iv_.15_31;
  ivtmp_25 = ivtmp_39 - 1;
  _13 = vect_vec_iv_.15_31 + { 4, 4, 4, 4 };
  vectp_e.16_38 = vectp_e.16_19 + 16;
  ivtmp_34 = ivtmp_18 + 1;
  if (ivtmp_34 < 4)
    goto <bb 12>; [77.75%]
  else
    goto <bb 4>; [22.25%]

  <bb 12> [local count: 3339337035]:
  goto <bb 3>; [100.00%]

  <bb 4> [local count: 955630224]:
  # d_21 = PHI <d_8(3)>
  # vect_vec_iv_.15_16 = PHI <vect_vec_iv_.15_31(3)>
  _1 = BIT_FIELD_REF <vect_vec_iv_.15_16, 32, 96>;
  d_40 = _1;
  if (d_21 != 16)
```

The problem is d_21/d_8 is not vectorized. it should have been _13[3] like how
d_40 is is vect_vec_iv_.15_31[3].

Reply via email to