https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120434
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Interesting clang/LLVM only does this for -Os and only on x86_64. I am agreeing it should be done at -O2 because it is almost always better to zero extend rather than sign extend on MOST if not all targets.