https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104344
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Charles Nicholson from comment #2) > 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 Yes, even with -fno-vectorize but not sure whether that disables all of it, that is, not sure in which optimization phase it pattern matches this.