https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85344
--- Comment #18 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Simple answer: When the INTEGER_CST (unsigned short) is expanded into a const_int, the sign extend happens due to the rules of const_int.