https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105930
--- Comment #14 from Linus Torvalds <torva...@linux-foundation.org> --- (In reply to Samuel Neves from comment #13) > Something simple like this -- https://godbolt.org/z/61orYdjK7 -- already > exhibits the effect. Yup. That's a much better test-case. I think you should attach it to the gcc bugzilla, I don't know how long godbolt remembers those links. But godbolt here is good for another thing: select clang-14 as the compiler, and you realize how even gcc-11 is actually doing a really really bad job. And I'm not saying that to shame anybody: I think it's more a sign that maybe the issue is actually much deeper, and that the problem already exists in gcc-11, but some small perturbation then just makes an already existing problem much worse in gcc-12. So that commit I bisected to is probably almost entirely unrelated, and it is just the thing that turns up the bad behavior to 11.