https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104344
--- Comment #2 from Charles Nicholson <charles.nicholson at gmail dot com> --- For whatever it's worth, clang does recognize both forms and emit optimal assembly at -Os: https://gcc.godbolt.org/z/sehxYb97E cast_through_char_unrolled: # @cast_through_char_unrolled movd eax, xmm0 ret cast_through_char_loop: # @cast_through_char_loop movd eax, xmm0 ret