[Bug tree-optimization/104344] Suboptimal -Os code for manually unrolled loop

charles.nicholson at gmail dot com gcc-bugzilla@gcc.gnu.org
Wed Feb 2 14:18:39 GMT 2022


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


More information about the Gcc-bugs mailing list