https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111515
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> --- I think performing the threading early is sound, it duplicates one stmt (store to h) for removing one conditional branch at runtime. And the estimate is computed correctly and 1 is what we allow. In _theory_ we could look at early-inline-insns and avoid any growth that would push us over the edge, but I'm not sure how feasible that would be. In principle we could also stop local optimizations once we reach a size that's good enough for early inlining. Or remember the original size before early opts and choose the minimum of that and the final IL we're attempting to inline. Honza? As for the bug I think everything works as designed, so not optimizing this anymore is a trade-off, aka not really a bug. But interesting nevertheless.