https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69032
--- Comment #2 from Andrey Belevantsev <abel at gcc dot gnu.org> --- Created attachment 37490 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=37490&action=edit proposed patch We fail to find the proper seqno for the fresh bookkeeping copy here. The problem is that in get_seqno_by_preds we are iterating over bb from the given insn backwards up to the first bb insn. We skip the initial insn when iterating over bb, yet we should take seqno from it. The code in question originally didn't include bb head when iterating, and was patched to do so in 2011. The patch was wrong and instead of including bb head managed to exclude the original insn itself. By reading the original and patched code I've convinced myself that the right fix will be to do what the patch intended and include both the initial insn and the bb head in the iteration. The patch fixes the reported testcase but I will have to test it more thoroughly before submitting.