Hello,

Doloop optimization fails to be applied on the following kernel from
tescase sms-4.c with mainline (-r 162294) due to 'Possible infinite
iteration
case' message; taken from the loop2_doloop dump. (please see below).
With an older version of gcc (-r 146278) doloop succeeded to be applied
and I appreciate an explanation about the change of behavior.

Thanks,
Revital

The kernel:

  unsigned int i, n = size;
  int changed = 0;

  for (i = 0; i < n; i++)
    {
      const int tmp = *ap++ | (*bp++ & *cp++);
      changed |= *dstp ^ tmp;
      *dstp++ = tmp;
    }

The messages from loop2_doloop dump:

Doloop: Possible infinite iteration case.
Doloop: The loop is not suitable.


Loop 1 is simple:
  simple exit 4 -> 5
  infinite if: (expr_list:REG_DEP_TRUE (ne:SI (and:DI (minus:DI (plus:DI
(ashift:DI (reg:DI 200)
                        (const_int 2 [0x2]))
                    (reg/v/f:DI 194 [ ap ]))
                (reg:DI 168 [ ivtmp.19 ]))
            (const_int 3 [0x3]))
        (const_int 0 [0]))
    (nil))

Reply via email to