https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70115
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Ok, so cunroll unrolls
for (; b < c; b++)
a++;
to "nothing" which releases b_2 but that is still used in the followup loops
nb_iterations expression,
b_2 >= c_19 ? (unsigned int) b_2 - (unsigned int) c_19 : 0
then CFG cleanup comes along merging two blocks and propagating out the PHI
node
# c_19 = PHI <c_3(8)>
which substitutes c_3 in that expression with c_19 and tries to simplify
the result b_2 >= c_19 which trips over the released SSA name.
Now I wonder if this shouldn't happen with loop-closed SSA as we have
a use of b_2 after its def loop (but the def is the loop header PHI).
Ah, but cunrolli is _not_ operating on loop-closed SSA form. If I change
that it exposes that cunroll has its own constant propagation replace-all-uses
function which misses loop meta data... which is actually the only thing I
need to fix here.