https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95075
--- Comment #2 from Iain Buclaw <ibuclaw at gdcproject dot org> --- """ I think I wrote it that way to emphasize what the result should be, and relied on the optimizer removing the self-assignment. So, the code is correct. """ So I'll remove the self-assignment with a comment expressing this instead.