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

--- Comment #2 from acsawdey at gcc dot gnu.org ---
Digging deeper, if i is not 64-bit, we don't choose it as one of the IVs, and
the loop iteration test gets converted based on ap instead. Then the math in
iv_number_of_iterations decides that it might be an infinite loop somehow. As a
result, doloop conversion isn't done, then later doloop_condition_get fails to
find the loop count register, and SMS is not done.

Loop 1 is simple:
  simple exit 5 -> 6
  infinite if: (expr_list:REG_DEP_TRUE (ne:SI (and:DI (minus:DI (plus:DI
(ashift:DI (reg:DI 211)
                        (const_int 2 [0x2]))
                    (reg/v/f:DI 205 [ ap ]))
                (reg:DI 193 [ ivtmp.20 ]))
            (const_int 3 [0x3]))
        (const_int 0 [0]))
    (nil))
  number of iterations: (lshiftrt:DI (plus:DI (minus:DI (reg:DI 203 [ _58 ])
            (reg:DI 193 [ ivtmp.20 ]))
        (const_int -4 [0xfffffffffffffffc]))
    (const_int 2 [0x2]))
  upper bound: 4294967294
  likely upper bound: 4294967294
  realistic bound: -1
Doloop: Possible infinite iteration case.
Doloop: The loop is not suitable.

Reply via email to