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

--- Comment #6 from bin cheng <amker at gcc dot gnu.org> ---
The address type iv_use has pointer type and 64-bit precision, while iv_cands
added (by ivcanon pass) has unsigned int type. So decremental candidates are
skipped because of following code:

4620│   /* Check if we have enough precision to express the values of use.  */
4621│   if (TYPE_PRECISION (utype) > TYPE_PRECISION (ctype))
4622├───> return infinite_cost;

Looks like better overflow-ness analysis is required here:
Candidate 6:
  Incr POS: orig biv
  IV struct:
    Type:       unsigned int
    Base:       1024
    Step:       4294967295
    Biv:        N
    Overflowness wrto loop niter:       Overflow  <------- here.

Reply via email to