https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120089
--- Comment #21 from Sam James <sjames at gcc dot gnu.org> --- The simplification of the array is debatable I think. Having many zeroes means that as a testcase, it's less likely to show up a problem. But it's still useful for debugging. But if you're going to go that route, you can cleanup all the loop logic as you don't ever check the 2nd vector element except for the last one.