https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98908
--- Comment #8 from Gabriel Ravier <gabravier at gmail dot com> --- Well, fixing a bug filed in 2021 in GCC 9 seems quite hard. Are you confused about the nature of the bug ? The first example in the description *is* the one whose optimization the bug is about, and it is the one that didn't optimize properly in trunk at the time of the bug being filed, back when trunk was GCC 11.0. I'm pretty sure this bug should be considering as fixed for GCC 12 considering it seems to have been fixed somewhere between GCC 11 (which has the bad code generation) and trunk (which doesn't).