https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116842
--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> --- The issue is that we have a load we hoist as invariant and that in turn uses hoist_defs_of_uses which moves in-loop stmts to the preheader. Those stmts have UIDs since they have stmt_vec_infos but the hoisting does not preserve their order which later confuses vect_stmt_dominates_stmt_p. I have a patch that preserves that order.