https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102997
--- Comment #11 from Aldy Hernandez <aldyh at gcc dot gnu.org> --- >From what I gather, this is only reproducible with PGO. If so, it may be worth nothing that Jeff has mentioned that the backward threader probably does not do a very good job with keeping profile counts up to date: https://gcc.gnu.org/pipermail/gcc-patches/2021-July/576437.html The compute_path_counts function he mentions above is not even used by the generic copier used by the backward threader, and currently all the threaders with the exception of DOM are using the backward threader. That being said, the commit this PR bisects to is not adding more threads, but invalidating some. Note the invalidation code works for all threaders, not just the back threader. This may have nothing to do with the issue at hand, but I thought it worth mentioning.