https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79437
--- Comment #1 from Matheus Izvekov <mizvekov at gmail dot com> --- Forgot to mention above, all gcc versions including the unreleased 7.0 and below as far as I could test (4.6) are affected by this. For comparison, clang generates optimal code for all cases.