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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
The tail loop ends up with completely off initial conditions because its
values are computed before pcom transform which ends up releasing the
SSA names used therein.  Then unrolling assigns some random new SSA names
to them.

So it seems to me that pcom doesn't deal with the case of a tail loop
at all - at least it doesn't compute entry values for that.  There isn't
a 1:1 relation between the values either and the old IVs are removed.
Also there seems to be always at least one tail iteration.

In the existing testcases the old IVs simply don't become dead.

So we have to restrict unrolling to the case where we don't replace looparound
PHIs.

Reply via email to