https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48877
Ivan Sorokin <vanyacpp at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |vanyacpp at gmail dot com --- Comment #2 from Ivan Sorokin <vanyacpp at gmail dot com> --- Modern GCC doesn't generate excessive moves for this example. It looks like the problem was fixed in 4.9.0: https://godbolt.org/z/MqE7sP . I think the bug can be closed now.