https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118852
--- Comment #11 from Richard Biener <rguenth at gcc dot gnu.org> --- The bug also reproduces with -msse4.2 instead of -march=x86-64-v2 and there it seems to reproduce more reliably. When I edit tree-flow-inline.h to perform loop header copying vectorization is then the with or without -fprofile-generate but the issue does not reproduce without -fprofile-generate. And with the source change and -fprofile-generate the issue does not reproduce either but then I see versioning for alignment being used (huh). Of -Ofast it is -fallow-store-data-races that's required - likely to sink the coverage stores out of the loop. So the new minimal set to reproduce is -O3 -msse4.2 -fallow-store-data-races -fno-inline-functions-called-once -fno-tree-slp-vectorize -fprofile-generate -fdbg-cnt=vect_loop:6-6 and the single vectorized loop is then in the set_hashtable_value_ids function. I've disabled most followup gimple passes to no avail. You can split out the first loop from set_hashtable_value_ids into its own function and have only that vectorized and the issue reproduces.