https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103351
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> --- So the issue is that iterative_hash_expr of &__str._M_local_buf is not the same for -g vs. -g0 which results in different ordering of the vector of PHI arguments in sorted form. First there's missing ordering we can use based on ->dest_idx which should stabilize the sort somewhat. But then it might still be that we end up with different basic-block numbers when there are two clusters of same PHI args and thus two forwarders to be generated. In the end this is because we hash in DECL_UID which are not the same here (2872 vs 2873) which is OK. So for the latter issue not exposed in this testcase we should order clusters after the first ->dest_idx for example. Though I'm not sure it is an isssue (but it could also improve stability of testcases when reducing). I'll try to fixup piecewise.