https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111517
--- Comment #6 from Axel Mueller <aegges at web dot de> --- I can confirm that the code now works with trunk version on godbolt. Thanks for the quick analysis (and of course the fix). Looking forward to the 12.4 fix release.